+ Reply to Thread
Results 1 to 3 of 3

Exit Userform+Excel without saving.

  1. #1
    Registered User
    Join Date
    05-08-2016
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    14

    Exit Userform+Excel without saving.

    Hello.

    I have a userform that runs like a solo application.

    When I want to exit de userform it pop's up a msg box :
    Please Login or Register  to view this content.
    So when the user chooses "yes" it's suppose to save the workbook and exit.
    Please Login or Register  to view this content.
    if "no" then
    Please Login or Register  to view this content.
    So the problem is: either if the user picks "yes" or "no" it always saves and exit's the userform + the excel book.

    Any ideas?
    I've already trie a lot of different codes to do this but nothing seems to work.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Exit Userform+Excel without saving.

    Change to
    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Exit Userform+Excel without saving.

    You need to set a variable to the answer. At the moment, you are testing the value of a constants.

    Please Login or Register  to view this content.
    Martin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA userform with a message prompt to save or exit without saving
    By Jakeyboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2015, 08:57 AM
  2. Textbox exit event prevents to exit userform
    By smjjvh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2014, 06:08 AM
  3. Texbox exit event prevents userform exit
    By smjjvh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2014, 05:47 AM
  4. Exit Userform to return to main code, but keep userform open
    By jombler74 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-04-2014, 04:01 AM
  5. Replies: 5
    Last Post: 06-27-2014, 02:10 AM
  6. IF Statements + MsgBox and Exit Excel without saving
    By johnnywinter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2009, 09:13 PM
  7. [SOLVED] Looping procedure calls userform; how to exit loop (via userform button)?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2005, 08:05 AM

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