Hide Columns [Solved/Closed]

Report
Posts
41
Registration date
Thursday June 16, 2011
Status
Member
Last seen
May 7, 2014
-
Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
-
Hello,
I recorded a macro to hide some columns (says, column M to O). However, when I tried to run the macro again, the macro hide all the columns from A to O. Below is the code for the macro.

Sub Macro9()

ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("M:O").Select
Range("M2").Activate
Selection.EntireColumn.Hidden = True
ActiveWindow.LargeScroll ToRight:=-1
Range("E8").Select
End Sub

Please help and advice.

Thank you.

Best regards,
wliang

1 reply

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
797
this macro will do

Sub test()
Range("M1:O1").EntireColumn.Hidden = True
End Sub

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!