Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Boxes | Excel Discussion (Misc queries) | |||
Macro Boxes | Excel Discussion (Misc queries) | |||
Toggle comments on or off macro | Excel Discussion (Misc queries) | |||
Macro that can run combo boxes | Excel Discussion (Misc queries) | |||
workbook Protection Toggle Macro | Excel Discussion (Misc queries) |