edwardzbrown
New Member
- Joined
- Jun 12, 2017
- Messages
- 20
Hello, I have an axtive X toggle button that works pretty slick. It shows and hides a range of rows by use of hidden "addresses" - basically a cell with a range it looks for.
But now I want to simply use a show/hide form button that works similar to another form control I use:
How do I change the code to do the show hide without the toggle button IF function? I want to use the same WITH command from the form control button but with the row finding "address" function I used before. Is that possible?
HTML:
Private Sub ToggleButton1_Click()
Dim xAddress As String
rw1 = ActiveWorkbook.ActiveSheet.Columns(1).Find(99991).Rowrw2 = ActiveWorkbook.ActiveSheet.Columns(1).Find(99992).Row
xAddress = rw1 & ":" & rw2
If ToggleButton1.Value Then Application.ActiveSheet.Rows(xAddress).Hidden = False ToggleButton1.Caption = "Hide"Else Application.ActiveSheet.Rows(xAddress).Hidden = True ToggleButton1.Caption = "Show"End If
End Sub
But now I want to simply use a show/hide form button that works similar to another form control I use:
HTML:
Sub HideButton_Click()'Show and Hide The Heading Bar
With Rows("2:3")Rows("2:3").EntireRow.Hidden = Not Rows("2:3").EntireRow.HiddenEnd With
End Sub
How do I change the code to do the show hide without the toggle button IF function? I want to use the same WITH command from the form control button but with the row finding "address" function I used before. Is that possible?