98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Exit or End?
Exit or End?
Resolved · Low Priority · Version 2007
Bethan has attended:
Excel VBA Intro Intermediate course
Access Intermediate course
Exit or End?
When would I use Exit Sub not End Sub?
RE: Exit or End?
Hi Bethan, thanks for the query. Exit Sub stops the procedure where it currently is. You normally use this when you've still got some following code *within the procedure* e.g. your error handler, or any code that has been labelled. The End Sub statement indicates the end of the code for that procedure as a whole. You always need an End Sub at the end of the procedure, and you use Exit Sub to stop the code running at a particular point other than the literal end of the code. A bit complicated but important nonetheless!
Hope this helps,
Anthony
Wed 16 Dec 2009: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Creating charts in Excel 2010Here's how to present your data in a chart format: |