Consulting

Results 1 to 3 of 3

Thread: Kill Macro from UserForm

  1. #1
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location

    Kill Macro from UserForm

    How would I kill a macro - just end it all - from a userform called from a macro?

    Brief description:
    Macro is called.
    Userform is called
    If Cancel, Exit userform & macro
    else continue macro.

    I think I'm over scrutinizing this a little bit..

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Use the End statement to stop ALL code.



    If (Cancel Command Button Is Pressed) Then
    End
    Else
    'More Code Here
    End If

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Ah, very cool! I didn't know you could do that, exactly what I was looking for. Thanks Jake! Youdda man!!

Posting Permissions

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