Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 349
Default macro boxes: toggle on/off

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Boxes Peter Excel Discussion (Misc queries) 4 October 5th 07 12:34 AM
Macro Boxes Peter Excel Discussion (Misc queries) 0 October 4th 07 06:06 PM
Toggle comments on or off macro Jim G Excel Discussion (Misc queries) 3 October 5th 06 04:07 AM
Macro that can run combo boxes simonsmith Excel Discussion (Misc queries) 0 June 5th 06 05:00 PM
workbook Protection Toggle Macro Just Learning Excel Discussion (Misc queries) 3 August 30th 05 11:03 PM


All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"