View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
JLatham
 
Posts: n/a
Default Macro to show a button?

You can simplify that even more to become a toggle switch by using this code

ActiveSheet.Shapes("CommandButton1").Visible =
Not(ActiveSheet.Shapes("CommandButton1").Visible)

it will flip flop back and forth between Visible/Not Visible (True/False)
each time it's called.

"Bearacade" wrote:


Sure there is, try this:

If ActiveSheet.Shapes("CommandButton1").Visible = True Then
ActiveSheet.Shapes("CommandButton1").Visible = False
ElseIf ActiveSheet.Shapes("CommandButton1").Visible = False Then
ActiveSheet.Shapes("CommandButton1").Visible = True
End If


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=554655