View Single Post
  #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?