How can I hide and then unhide a button on a worksheet? Thanks.
Printable View
How can I hide and then unhide a button on a worksheet? Thanks.
Like this?
VB Code:
Private Sub CommandButton1_Click() CommandButton1.Visible = False End Sub Private Sub Worksheet_Activate() CommandButton1.Visible = True End Sub
Hopefully this give you the general idea.
You will need to change "CommandButton1" to the name of your button and will need to change the worksheet number to whichever sheet has the button.
VB Code:
Sub ToggleButton() With Worksheets(1).Shapes("CommandButton1") If .Visible = False Then .Visible = True Else .Visible = False End If End With End Sub
Terrific. Thanks.