|
-
Dec 15th, 2005, 12:22 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Excel - how do you hide a button
How can I hide and then unhide a button on a worksheet? Thanks.
-
Dec 15th, 2005, 12:26 PM
#2
Re: Excel - how do you hide a button
Like this?
VB Code:
Private Sub CommandButton1_Click()
CommandButton1.Visible = False
End Sub
Private Sub Worksheet_Activate()
CommandButton1.Visible = True
End Sub
-
Dec 15th, 2005, 12:29 PM
#3
Re: Excel - how do you hide a button
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
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Dec 15th, 2005, 12:47 PM
#4
Thread Starter
Hyperactive Member
Re: Excel - how do you hide a button
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|