How do I exit a macro subroutine?
I test some conditions in my macro, and if certain things are wrong, I
display a msgbox and then want to terminate the macro. I tried a "Return" statement, but this get me a code error. What is the secret VBA subroutine exit command besides running out the end of the subroutine? |
How do I exit a macro subroutine?
Exit Sub:
See Exit Statement in VBA Help -- Gary's Student "John" wrote: I test some conditions in my macro, and if certain things are wrong, I display a msgbox and then want to terminate the macro. I tried a "Return" statement, but this get me a code error. What is the secret VBA subroutine exit command besides running out the end of the subroutine? |
All times are GMT +1. The time now is 07:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com