+ Reply to Thread
Results 1 to 2 of 2

userform return value

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    userform return value

    I call a userform and need to determine whether the user clicked "OK" or "Cancel" on the form. Is there a way to do this without setting a global variable and checking it after the form is closed?

    I want to say something like:

    Please Login or Register  to view this content.
    where "run" is a method in userForm1 that returns a different value for OK and Cancel. But I don't know how to make this happen.

    Thanks Andy!
    Last edited by gtmeloney; 07-08-2009 at 12:24 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: userform return value

    Here's how I do it for my userforms.

    standard code module
    Please Login or Register  to view this content.
    Userform1 with 2 buttons
    code
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ 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