+ Reply to Thread
Results 1 to 2 of 2

How do I exit a macro subroutine?

  1. #1
    John
    Guest

    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. #2
    Gary''s Student
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1