Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Exit via macro only? | Excel Discussion (Misc queries) | |||
[Fwd: Run macro on exit worksheet/workbook] | Excel Discussion (Misc queries) | |||
Run macro on exit worksheet/workbook | Excel Worksheet Functions | |||
on exit macro | Excel Discussion (Misc queries) |