phil152003
Board Regular
- Joined
- Mar 11, 2011
- Messages
- 89
In my spreadsheet, I have 3 sets of columns that are grouped together separately. I want to have a macro that shows/hides each group.
The problem is that because they are all separately grouped, the groups are all in row 1 in the group bar that appears at the top of the sheet (the part where if you click 1 the groups hide, and if you click 2, the groups unhide).
I found this code, which in effect clicks the "1" or "2", and so all the groups become hidden or unhidden:
But as I initially said, I want a button that will result in, for example, one group unhidden, while the other two remain hidden. Any suggestions? Thanks.
The problem is that because they are all separately grouped, the groups are all in row 1 in the group bar that appears at the top of the sheet (the part where if you click 1 the groups hide, and if you click 2, the groups unhide).
I found this code, which in effect clicks the "1" or "2", and so all the groups become hidden or unhidden:
Code:
Sub Hide_Everything()
'
' Hide_Everything Macro
'
'
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
End Sub
Sub Show_Everything()
'
' Show_Everything Macro
'
'
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=2
End Sub
But as I initially said, I want a button that will result in, for example, one group unhidden, while the other two remain hidden. Any suggestions? Thanks.