Layered Toggle Buttons

ArmysBest

New Member
Joined
Mar 20, 2020
Messages
2
Office Version
2019
Platform
Windows
Can two separate toggle buttons cover a similar range?

Let me explain...
Essentially I want them to work together very similar to a file tree
Category 1
Child category 1
Data
Data
Data
Child category 2
Data
Data
Category 2

First I placed all the categories, sub categories, and data. I then added a togglebutton for each sub category and was able to minimize them all just fine. I then placed one in the parent category covering the full range and suddenly all my sub categories would no longer minimize/expand....

Here is my code
**NOTE THIS IS MY PARENT CATEGORY******
Private Sub TogBtnGameCollection_Click()
Dim cells As String
cells = "51:77"
If TogBtnGameCollection.Value = True Then
Application.ActiveSheet.Rows(cells).Hidden = False
TogBtnGameCollection.Caption = "-"
Else
Application.ActiveSheet.Rows(cells).Hidden = True
TogBtnGameCollection.Caption = "+"
End If
End Sub
****NOTE THIS IS THE FORMAT OF MY CHILD CATEGORIES*****
Private Sub TogBtnPlaystation3_Click()
Dim cells As String
cells = "52:57"
If TogBtnPlaystation3.Value = True Then
Application.ActiveSheet.Rows(cells).Hidden = False
TogBtnPlaystation3.Caption = "-"
Else
Application.ActiveSheet.Rows(cells).Hidden = True
TogBtnPlaystation3.Caption = "+"
End If
End Sub


As I said the sub categories all worked great until I put the one covering all of them. Is there a way to do this? If toggle Buttons Can't do it can something else?
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

kennypete

Board Regular
Joined
Apr 19, 2008
Messages
227
Office Version
365, 2019
Platform
Windows
Unless there is a particular reason not to, why not use the Group function in Excel?
1128177.gif

...with settings:
1584814336702.png
>
1584814357524.png
 

Watch MrExcel Video

Forum statistics

Threads
1,099,044
Messages
5,466,210
Members
406,473
Latest member
Dunno123

This Week's Hot Topics

Top