Link to home
Start Free TrialLog in
Avatar of davsay

asked on

Exiting Subs

I have a number of sub routines all called one by one from a kind of master sub. I have an exit sub statement in the first sub (based on a value from an inputbox) - my question is: can i get the code to completely stop altogether, rather than quitting that particular sub and going to the next. I guess i could put code in the other subs to text the condition also, but there's about six of them. Suppose i'm being lazy really, but just wondered if you clever people have a quick way. Thanks.

Ps. and what happened to posting 10 point questions on this thing?
Avatar of Arthur_Wood
Flag of United States of America image

what programming language are you using?

Avatar of ksokolowski

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davsay


Ok, (this was in Excel VBA by the way).

I think i have it, inspired by K's answer so you can have the points. This was way easier than i first thought and really my question was probably misguided. Things seem much clearer this morning. To remedy the situation I just put a condition in the main sub (the one that calls the others). The original test condition was in the first sub (that actually did something) I incorrectly thought it would run through all the otehrs, but of course it goes back to the main sub to get its next direction. Silly me.