![]() |
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 |
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 |
All times are GMT +1. The time now is 02:07 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com