Code to hide columns isn't working

dontasciime

New Member
Joined
May 25, 2010
Messages
7
I am having trouble with some vba code to hide columns. I need to hide column L:M and also O:AC. Whenever I run the macro it ends up hiding column N which has to be shown. I don't know whats wrong with it. Could someone help? I am using Excel 2007. This seems so basic yet I don't know why it isn't working. I've even tried adding in a line Selection.EntireColumn.Hidden = False for column N but that doesn't work either.

Code:
Sub Condense()
    Columns("L:M").Select
    Selection.EntireColumn.Hidden = True
    Columns("O:AC").Select
    Selection.EntireColumn.Hidden = True
End Sub
 
Sub Condense()
Columns("L:AC").EntireColumn.Hidden = True
Columns("N:N").EntireColumn.Hidden = False
End Sub
 
Upvote 0

We've detected that you are using an adblocker.

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.
Go back
Back
Top