ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Promote / Demote (https://www.excelbanter.com/excel-programming/289142-promote-demote.html)

Giuseppe[_2_]

Promote / Demote
 
I will like to hide and exanpand columns in a spread
sheet. I was sucesfully doing this grouping the columns in
the Data menu and using the outline function. Does anybody
know hat to hide and show the columns fron a VBA code?

Thanks,

Giuseppe

tolgag[_22_]

Promote / Demote
 
Hi,

To hide the columns A to K :
Columns("A:K").Hidden = True

to show :
Columns("A:K").Hidden = false

With a loop you can do the same thing as follows :

Dim i as integer

i = 1

For i = 1 to 10

Columns(i).Hidden = true

Nex

--
Message posted from http://www.ExcelForum.com


BrianB

Promote / Demote
 
The easiest way is to record a macro while you do it.

Regards
BrianB
==========================================


"Giuseppe" wrote in message ...
I will like to hide and exanpand columns in a spread
sheet. I was sucesfully doing this grouping the columns in
the Data menu and using the outline function. Does anybody
know hat to hide and show the columns fron a VBA code?

Thanks,

Giuseppe



All times are GMT +1. The time now is 07:05 PM.

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