Hi
Can I use same button to reverse macro
In attached example, if I click HIDE button it hides, but want to unhide if Its clicked again.
Much appreciates
Thanks in advance
Change the button to a command button. This makes the coding a bit more straight forward. Named the commandbutton cbB1.
Code:
Private Sub cmdB1_Click()
If cmdB1.Caption = "Unhide" Then
Rows("7:16").EntireRow.Hidden = False
cmdB1.Caption = "Hide"
Else: Rows("7:16").EntireRow.Hidden = True
cmdB1.Caption = "Unhide"
End If
End Sub