Complete Instructions
Step 1: Open VBA Editor
- Press
Alt + F11(opens VBA editor)
Step 2: Insert Module
- In the VBA editor, click Insert → Module
- A blank code window will appear
Step 3: Paste the Macro
- Copy and paste this code into the module:
Sub
DeleteBetweenCAndQY()
Columns("D:QX").Delete
End Sub
Step 4: Run the Macro
- Press
F5(or click the ▶️ Run button) - The columns will be deleted immediately
- Press
Alt + Qto close the VBA editor
Step 5: Remove the Macro
- Press
Alt + F11again (reopen VBA editor) - In the left panel (Project Explorer), find your workbook
- Expand Modules folder
- Right-click on Module1
- Choose Remove Module1
- Click No when asked "Do you want to export before removing?"
- Press
Alt + Qto close VBA editor
Step 6: Save Normally
- Press
Ctrl + Sto save - Excel will save as a regular
.xlsxfile (no macro warning)