ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA: Collapse Column Groupings (https://www.excelbanter.com/excel-discussion-misc-queries/247777-vba-collapse-column-groupings.html)

CM4@FL[_2_]

VBA: Collapse Column Groupings
 
I have a spreasheet with Columns H-AB, BD-BF, and BJ-CD grouped. Therefore I
have 1 level of column grouping. What is the VBA code to collapse and expand
these groupings?

Thanks in advance

joel[_7_]

VBA: Collapse Column Groupings
 

I think you would want to keep the 1st columns H, BD, and BJ and hid the
other columns or unhide these columns

columns("I:AB").Hide
columns("BE:BF").Hide
columns("BK:CD").Hide

columns("I:AB").UnHide
columns("BE:BF").UnHide
columns("BK:CD").UnHide


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=151848

Microsoft Office Help



All times are GMT +1. The time now is 09:53 PM.

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