ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to Hide columns (https://www.excelbanter.com/excel-discussion-misc-queries/246372-macro-hide-columns.html)

whatzzup

Macro to Hide columns
 
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

Fred Smith[_4_]

Macro to Hide columns
 
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.

"whatzzup" wrote in message
...
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



Jacob Skaria

Macro to Hide columns
 
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
---------------
Jacob Skaria


"whatzzup" wrote:

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


Mike H

Macro to Hide columns
 
Hi,

Range("G:H, U:U, AC:AC, AE:AE").EntireColumn.Hidden = True

Mike

"whatzzup" wrote:

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



All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com