I would appreciate help for implementing a button-activated macro for hiding/unhiding a range of rows at different locations on down the sheet. I would like to have a separate button for each location. Each button (labelled "More Rows") passes the range of target rows (or the button number, from which the range can be computed) to a shared Sub. The Sub would test the status of the toggle and perform the action of "unhide" for "button down" and "hide" for "button up" for the requested rows. The following is nonworking code I have entered so far:
Private Sub ToggleButton1_Click()
Rows("24:28").Select 'Need to make row range an input argument
If Status.ToggleButton1 = True Then 'Invalid statement
Selection.EntireRow.Hidden = False
Else
Selection.EntireRow.Hidden = True
End If
End Sub
Thanks -- Bernie
Private Sub ToggleButton1_Click()
Rows("24:28").Select 'Need to make row range an input argument
If Status.ToggleButton1 = True Then 'Invalid statement
Selection.EntireRow.Hidden = False
Else
Selection.EntireRow.Hidden = True
End If
End Sub
Thanks -- Bernie