Thread: exit sub
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Stone Frank Stone is offline
external usenet poster
 
Posts: 134
Default exit sub

your example is a bit confusing. but if code stops before
a call, the call is never made. move your call to the end
of sub1(or at least after the exit sub command.) Some
where you will have to add a exit sub command in sub1 to
stop it from call sub2. now...where to put the exit sub
command. you didn't provide enought information to answer
that.
-----Original Message-----
how do i get out of all subs upon a certain event?

sub1()
call sub2
'more code here--i do not want sub1 to get this far

unless sub2 runs all the
way through
end sub

sub2()
if 1=1 then
exit sub 'i want this to quit sub1 as well as sub2
end if
end sub

there may be more embedded subs, so i don't think i can

specify which sub to
exit (if that is even possible).
thanks, mike allen


.