In a test workbook, sheet1, place the letter of the colum in each cell in row 1, from column A thru column Z.
Copy the following code:
Code:
Sub DeleteColumnsDFKZ()
'
' DeleteColumnsDFKZ Macro
' Macro created 10/11/2006 by Stanley D. Grom, Jr.
'
Range("D1,F1,K1,Z1").Select
Range("Z1").Activate
Selection.EntireColumn.Delete
Range("A1").Select
End Sub
Press Alt F11, and paste into the VBA Project, Sheet1(Sheet1).
I want to be able to use the macro to turn off the cols temporarily. save the sheet with a different name and then use the sheet in its original format with its original name.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.