Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sub routine

Status
Not open for further replies.

cochise

Technical User
Mar 27, 2001
171
US
Is there a way to exit out of a sub routine once a certain condition has been met? I have an If statement, which if true, I would like it to exit the sub routine and not continue with the rest of the code. Any help would be great. I tried exit sub, but it doesn't seem to work.
 
Exit sub is the correct way to exit an instance of a sub. After the Exit Sub is executed, flow continues to the next line of the routine that called that Sub. How is it not working for you? Specifically?
 
Okay, you're right. I had the exit sub in the wrong sub. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top