ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   macro to hide columns (https://www.excelbanter.com/excel-worksheet-functions/47461-macro-hide-columns.html)

Shooter

macro to hide columns
 
My spreadsheet has data in cells A1:G20. I would like to create a macro to
hide columns D, E, F&G. Similarly, I would like to create a macro to unhide
the same columns. I appretiate your help with code to do this.
--
Shooter

Ron de Bruin

Try

ActiveSheet.Range("D1:G1").EntireColumn.Hidden = True

Set it to false to unhide them


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Shooter" wrote in message ...
My spreadsheet has data in cells A1:G20. I would like to create a macro to
hide columns D, E, F&G. Similarly, I would like to create a macro to unhide
the same columns. I appretiate your help with code to do this.
--
Shooter




Anne Troy

Shooter: This is a no-brainer that can be recorded. See how to record a
macro he
http://www.officearticles.com/excel/...soft_excel.htm
************
Anne Troy
www.OfficeArticles.com


"Shooter" wrote in message
...
My spreadsheet has data in cells A1:G20. I would like to create a macro to
hide columns D, E, F&G. Similarly, I would like to create a macro to
unhide
the same columns. I appretiate your help with code to do this.
--
Shooter





All times are GMT +1. The time now is 04:40 PM.

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