H
hmaze
All:
I am using a toggle button to hide/unhide selected rows on different
spreadsheets. The code below works on one sheet but as soon as I move to a
different sheet I get an error message (see ** where error is). Any
suggestions, it's getting stuck at Rows 8:21").Select - Thank you.
Private Sub ToggleButton1_Click()
Static blflag As Boolean
blflag = Not blflag
If blflag Then
Range("15:16,19:22").Select
Range("A19").Activate
Selection.EntireRow.Hidden = False
Sheets("Spread Analysis").Select
**Rows("8:21").Select
Selection.EntireRow.Hidden = False
Sheets("Client Analysis ").Select
Rows("8:18").Select
Selection.EntireRow.Hidden = False
Sheets("Input Variables").Select
Else
Range("15:16,19:22").Select
Range("A19").Activate
Selection.EntireRow.Hidden = True
Sheets("Spread Analysis").Select
Rows("8:21").Select
Selection.EntireRow.Hidden = True
Sheets("Client Analysis ").Select
Rows("8:18").Select
Selection.EntireRow.Hidden = True
Sheets("Input Variables").Select
End If
End Sub
I am using a toggle button to hide/unhide selected rows on different
spreadsheets. The code below works on one sheet but as soon as I move to a
different sheet I get an error message (see ** where error is). Any
suggestions, it's getting stuck at Rows 8:21").Select - Thank you.
Private Sub ToggleButton1_Click()
Static blflag As Boolean
blflag = Not blflag
If blflag Then
Range("15:16,19:22").Select
Range("A19").Activate
Selection.EntireRow.Hidden = False
Sheets("Spread Analysis").Select
**Rows("8:21").Select
Selection.EntireRow.Hidden = False
Sheets("Client Analysis ").Select
Rows("8:18").Select
Selection.EntireRow.Hidden = False
Sheets("Input Variables").Select
Else
Range("15:16,19:22").Select
Range("A19").Activate
Selection.EntireRow.Hidden = True
Sheets("Spread Analysis").Select
Rows("8:21").Select
Selection.EntireRow.Hidden = True
Sheets("Client Analysis ").Select
Rows("8:18").Select
Selection.EntireRow.Hidden = True
Sheets("Input Variables").Select
End If
End Sub