Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
exit sub
Is there a way to exit 2 subs if 1 has called the other. eg:
Sub 1 code...... code.....(if criteria met then) Sub2 Code... End sub Sub 2 Code.... exit sub(this sub and sub1 if certain criteria not met) else continue code end sub I know I could set a variable to true or false, but was wondering if there was a way to just exit all subs/macros. Regards Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
exit sub
The quick answer is no.
Another method: You could have an error handler in only the topmost sub and raise an error in the lowest sub. another is to make the second sub a function and react to the returned value (similar to what you spoke of). -- Regards, Tom Ogilvy "RobcPettit" wrote: Is there a way to exit 2 subs if 1 has called the other. eg: Sub 1 code...... code.....(if criteria met then) Sub2 Code... End sub Sub 2 Code.... exit sub(this sub and sub1 if certain criteria not met) else continue code end sub I know I could set a variable to true or false, but was wondering if there was a way to just exit all subs/macros. Regards Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
exit sub
What about:
If Condition Then Exit Sub End If |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
exit sub
Thanks for both your replys. Thats what I was thinking, thanks for the
confirmation. Regards Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If Then Else with Exit For | Excel Programming | |||
how to exit sub | Excel Programming | |||
exit while? | Excel Programming | |||
If a called sub exit, how to the caller exit right away? | Excel Programming | |||
Exit Sub? | Excel Programming |