Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referring to column or row grouping using VB
I have a combination of column & row groupings that I've created on a
worksheet using the Data Group/Ungroup function. When running certain macros, I want to either expand or collapse these groupings based on my needs. I cannot figure out how to reference these groupings within my VB code to ensure the proper rows/columns are hidden/unhidden as necessary. For example, assuming I have two 'levels' within my column groupings. If I want to see all columns, I manually select the "1" in my column outline grid to expand all columns. If I want to hide the secondary columns, I click the "2" and these columns are hidden. I want to simulate this action using VB. Is there any way to do this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referring to column or row grouping using VB
ActiveSheet.Outline.ShowLevels RowLevels:=2, ColumnLevels:=2
The above code expands all groupings....conversely ActiveSheet.Outline.ShowLevels RowLevels:=1, ColumnLevels:=1 the above code collapses all groupings. -- Thanks, PTweety "jday" wrote: I have a combination of column & row groupings that I've created on a worksheet using the Data Group/Ungroup function. When running certain macros, I want to either expand or collapse these groupings based on my needs. I cannot figure out how to reference these groupings within my VB code to ensure the proper rows/columns are hidden/unhidden as necessary. For example, assuming I have two 'levels' within my column groupings. If I want to see all columns, I manually select the "1" in my column outline grid to expand all columns. If I want to hide the secondary columns, I click the "2" and these columns are hidden. I want to simulate this action using VB. Is there any way to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referring to a portion of a column | Excel Discussion (Misc queries) | |||
Referring to a row or column | Excel Programming | |||
Referring to a column | Excel Discussion (Misc queries) | |||
Referring to a column | Excel Programming | |||
Referring to a column | Excel Programming |