Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop running a macro in the middle of a macro
Hi,
I have a macro that runs another macro in it, something like this Sub mymacro () code Myothermacro code End sub Sub Myothermacro() Msgbox If no then Exit Sub End if End Sub When I run the macro, if the answer is NO, it ends Myothermacro but then resumes mymacro. How can I have a messagebox in Myothermacro have a DEAD STOP and return to sheet? Any help is appreciated |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop running a macro in the middle of a macro
Sub mymacro ()
code If Myothermacro Then code End if End sub Function Myothermacro() Msgbox If no then MyOtherMacro = False else MyOtherMacro = True End if End Function -- Regards, Tom Ogilvy "gmunro" wrote in message oups.com... Hi, I have a macro that runs another macro in it, something like this Sub mymacro () code Myothermacro code End sub Sub Myothermacro() Msgbox If no then Exit Sub End if End Sub When I run the macro, if the answer is NO, it ends Myothermacro but then resumes mymacro. How can I have a messagebox in Myothermacro have a DEAD STOP and return to sheet? Any help is appreciated |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop running a macro in the middle of a macro
How about dim public StopFlag
set the stopflag in your second macro and test for it on return to your first macro Chris "gmunro" wrote in message oups.com... Hi, I have a macro that runs another macro in it, something like this Sub mymacro () code Myothermacro code End sub Sub Myothermacro() Msgbox If no then Exit Sub End if End Sub When I run the macro, if the answer is NO, it ends Myothermacro but then resumes mymacro. How can I have a messagebox in Myothermacro have a DEAD STOP and return to sheet? Any help is appreciated |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop running a macro in the middle of a macro
Thank you
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I stop a Macro from running? | Excel Worksheet Functions | |||
How to stop getting the file save box when running a macro | Excel Discussion (Misc queries) | |||
How to stop a macro while it is running ? | Excel Programming | |||
When Save As stop running macro | Excel Programming | |||
How to Pause or Stop a running Macro | Excel Programming |