View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chipmunk Chipmunk is offline
external usenet poster
 
Posts: 7
Default Macro Toggle On/Off

Thanks, that did it. Well I changed MsgBox to Call. Thanks again.

"Norman Jones" wrote:

Hi Chipmunk,

Try something like:

'=============
Public Sub ToggleIt()
Static blFlag As Boolean

blFlag = Not blFlag

If blFlag Then
'Action 1 e.g.:
MsgBox "Action1"
Else
'Action 2 , e.g.:
MsgBox "Action 2"
End If

End Sub
'<<=============


---
Regards,
Norman


"Chipmunk" wrote in message
...
Hello, how can I execute two different macros from a single toggle button?

Example: I press the toggle button and macro1 executes,
I press the same button again and macro2 executes,
I press the same button again and macro1 executes etc...

Thanks