Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Stop running a macro in the middle of a macro

Thank you

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop a Macro from running? JulianB Excel Worksheet Functions 1 April 10th 06 10:33 PM
How to stop getting the file save box when running a macro Pank Mehta Excel Discussion (Misc queries) 1 March 29th 05 04:05 PM
How to stop a macro while it is running ? Srikanth[_7_] Excel Programming 1 September 15th 04 12:59 AM
When Save As stop running macro M K W Excel Programming 3 September 2nd 03 03:06 PM
How to Pause or Stop a running Macro jfeka[_2_] Excel Programming 0 July 17th 03 11:14 PM


All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"