Macro to Hide columns

W

whatzzup

Good afternoon,
I am trying to create a macro to hide certain columns on a spreadsheet, how
best do i do this, say want to hide columns g, h, u, ac & ae
 
F

Fred Smith

The best way is to record the macro. Turn on the macro recorder, hide your
columns, then stop the recorder. You can then look at the code by pressing
alt+F11.

Regards,
Fred.
 
J

Jacob Skaria

Sub Macro()
Range("G1,H1,U1,AC1,AE1").EntireColumn.Hidden = True
'OR
'Range("G:G,H:H,U:U,AC:AC,AE:AE").Columns.Hidden = True
End Sub

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top