Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a toggle button that when clicked ON I want to run
one code and when clicked OFF I want to run a different code. Is this possible?? Please help me out. --Keri |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If it is a toolbar button, you can set and check its State property.
If it is a commandbutton, then you could use a global variable and set /unset that, Dim fStatus As Boolean Private Sub CommandButton1_Click() If fStatus Then 'do one thing Else 'do an other End If fStatus = Not fStatus End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Keri" wrote in message ... I have a toggle button that when clicked ON I want to run one code and when clicked OFF I want to run a different code. Is this possible?? Please help me out. --Keri |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob told you how to do it with a commandbutton and a forms button.
If it is a toggle button as you imply Private Sub ToggleButton1_Click() if ToggleButton1.Value = True then ' depressed macro1 else macro2 End if End Sub -- Regards, Tom Ogilvy "Keri" wrote in message ... I have a toggle button that when clicked ON I want to run one code and when clicked OFF I want to run a different code. Is this possible?? Please help me out. --Keri |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toggle Button | Excel Worksheet Functions | |||
Toggle Button | Excel Discussion (Misc queries) | |||
Toggle button | Excel Discussion (Misc queries) | |||
Toggle Button | Excel Discussion (Misc queries) | |||
Toggle Button | Excel Programming |