truebluewoman
New Member
- Joined
- Sep 26, 2014
- Messages
- 36
I have a workbook that contains several types of R&M that is being performed on living quarters after our residents move out but before a new resident moves into a unit. The units are in rows and the types of work and details are in various columns.
There are about 8 separate types of work, but let's look at two specific ones, Painting and Cleaning.
Painting:
Columns U:Y and AE are the columns that we want to see when we click on the ToggleButton2. I named a range called ASSIGN_PT that contains everything that I want hidden EXCEPT those particular columns.
Cleaning:
Columns AF:AJ and AN are the columns that we want to see when we click on ToggleButton3. I named a range called ASSIGN_CLN that contains everything that I want hidden EXCEPT those particular columns.
I have two separate toggle buttons with the following code:
It worked fine when I added the first toggle button, but when I added the second one, the first one stopped being able to be clicked at all. Then I added a third one and the second one stopped working. I've gone in and out of design mode, so I know that's not it.
Now that I added the 3rd Toggle button, when I click on the toggle button 2, it just doesn't "depress" at all and I'm not sure why. It is not a protected workbook. I've added a couple of screenshots that shows what happens when I click on ToggleButton3 and another that shows what happens when I click on Toggle Button 2 (View Paint Assignments). I'm not sure what I am doing wrong, but I'm hoping that someone here can help me out. Thanks, in advance!
There are about 8 separate types of work, but let's look at two specific ones, Painting and Cleaning.
Painting:
Columns U:Y and AE are the columns that we want to see when we click on the ToggleButton2. I named a range called ASSIGN_PT that contains everything that I want hidden EXCEPT those particular columns.
Cleaning:
Columns AF:AJ and AN are the columns that we want to see when we click on ToggleButton3. I named a range called ASSIGN_CLN that contains everything that I want hidden EXCEPT those particular columns.
I have two separate toggle buttons with the following code:
VBA Code:
Private Sub ToggleButton2_Click()
If ToggleButton2.Value = True Then
Sheets("6 - Contractor Schedule").Range("ASSIGN_PT").EntireColumn.Hidden = True
ElseIf ToggleButton2.Value = False Then
Range("ASSIGN_PT").EntireColumn.Hidden = False
End If
End Sub
Private Sub ToggleButton3_Click()
If ToggleButton3.Value = True Then
Sheets("6 - Contractor Schedule").Range("ASSIGN_CLN").EntireColumn.Hidden = True
ElseIf ToggleButton3.Value = False Then
Range("ASSIGN_CLN").Columns.EntireColumn.Hidden = False
End If
End Sub
It worked fine when I added the first toggle button, but when I added the second one, the first one stopped being able to be clicked at all. Then I added a third one and the second one stopped working. I've gone in and out of design mode, so I know that's not it.
Now that I added the 3rd Toggle button, when I click on the toggle button 2, it just doesn't "depress" at all and I'm not sure why. It is not a protected workbook. I've added a couple of screenshots that shows what happens when I click on ToggleButton3 and another that shows what happens when I click on Toggle Button 2 (View Paint Assignments). I'm not sure what I am doing wrong, but I'm hoping that someone here can help me out. Thanks, in advance!