Macro to Hide columns

  • Thread starter Thread starter whatzzup
  • Start date Start date
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
 
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.
 
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
 
Back
Top