Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Exit via macro only? Brisbane Rob Excel Discussion (Misc queries) 1 October 13th 05 01:16 PM
[Fwd: Run macro on exit worksheet/workbook] toontje Excel Discussion (Misc queries) 1 August 5th 05 03:49 AM
Run macro on exit worksheet/workbook toontje Excel Worksheet Functions 3 August 2nd 05 10:15 PM
on exit macro ditchy Excel Discussion (Misc queries) 2 May 3rd 05 12:11 AM


All times are GMT +1. The time now is 07:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"