Thread: exit sub
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mike allen[_2_] mike allen[_2_] is offline
external usenet poster
 
Posts: 85
Default exit sub

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