NikkiBlast
New Member
- Joined
- Aug 21, 2019
- Messages
- 2
I'm working on a sheet that has multiple tables of data. One tracks budget and one tracks labor hours. In the labor Hours table, I created a toggle button that will hide rows containing employees who have contributed zero hours towards a project. It was working GREAT, but I had to make some tweaks to the table, and now when you click the button, it hides the rows correctly (using helper column "X"). However when you click it again to unhide them, it also unhides rows 34-45, despite their being outside the range I set (rows 48-72). I have examined this thing up and down and can't figure out why it is happening. Can someone check out my code below and see if they have any suggestions? My remaining sanity thanks you.
PHP:
Private Sub ToggleButton1_Click()
Set WS = Worksheets("Master")
Col = "X"
UpR = 72
LowR = 48
If ToggleButton1.Value = True Then
With WS
For FR = UpR To LowR Step -1
If .Range(Col & FR) = 0 Then
.Rows(FR).Hidden = True
End If
Next FR
End With
End If
If ToggleButton1.Value = False Then
WS.Rows.EntireRow.Hidden = False
End If
End Sub