gobblechops
New Member
- Joined
- Apr 27, 2017
- Messages
- 40
- Office Version
- 365
- Platform
- Windows
Hi,
Below is some VBA code used with a toggle button to hide/unhide rows 8:10. This works perfectly.
I need to amend the code so the button hides/unhides rows 16,22,23,26,30,32,46,49,52,55,58 AND Columns G,H,I,J.
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "8:10"
If ToggleButton1.Value Then
Application.ActiveSheet.Rows(xAddress).Hidden = True
ToggleButton1.Caption = "Show Scenario"
Else
Application.ActiveSheet.Rows(xAddress).Hidden = False
ToggleButton1.Caption = "Hide Scenario"
End If
End Sub
Thanks in advance.
Below is some VBA code used with a toggle button to hide/unhide rows 8:10. This works perfectly.
I need to amend the code so the button hides/unhides rows 16,22,23,26,30,32,46,49,52,55,58 AND Columns G,H,I,J.
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "8:10"
If ToggleButton1.Value Then
Application.ActiveSheet.Rows(xAddress).Hidden = True
ToggleButton1.Caption = "Show Scenario"
Else
Application.ActiveSheet.Rows(xAddress).Hidden = False
ToggleButton1.Caption = "Hide Scenario"
End If
End Sub
Thanks in advance.