exit sub

R

RobcPettit

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
 
T

Tom Ogilvy

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).
 
R

RobcPettit

Thanks for both your replys. Thats what I was thinking, thanks for the
confirmation.
Regards Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top