View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
papou[_2_] papou[_2_] is offline
external usenet poster
 
Posts: 112
Default macro boxes: toggle on/off

Hello Peter
Use the Toggle button control from the Controls tool box.
And use its Value property True / False to either Run / Not Run your macro.
eg:
Private Sub ToggleButton1_Click()
'Toggle is on : run my macro
If ToggleButton1.Value Then
'your macro to run
Macro1
'Toggle is off, exit code
Else: Exit Sub: End If
End Sub

HTH
Cordially
Pascal

"Peter" a écrit dans le message de news:
...
Hello there, I have created a box with a macro assigned to it and I can
click
it to run the macro but I would also like to be able to click it off, I've
seen this done before.

How can I do this? Is there some code to put into the already existing
code
for that option?

Thanks...Peter