+ Reply to Thread
Results 1 to 3 of 3

Doesn't show msgbox if I click in X to close Userform

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Doesn't show msgbox if I click in X to close Userform

    hi

    How prevent messagem after exit textbox in case I close my Userform using button -> X?

    If close my Userform and textbox date is empty, then Msgbox appear.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

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

    Re: Doesn't show msgbox if I click in X to close Userform

    You will need to use a variable to check the state of userform being closed and test that in the exit event.

    In addition if you have a Cancel button on your userform you will need to set the TakeFocusOnClick property of the button to False, so you can cancel the form without the message

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Doesn't show msgbox if I click in X to close Userform

    Hi Andy

    I test it, work like charm, thank you so much!

+ 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. [SOLVED] Userform command buttons, close on click
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2019, 08:19 AM
  2. [SOLVED] Yes/no msgbox -> if no is clicked, show userform with data still in it
    By pclaesen in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-04-2016, 04:16 PM
  3. [SOLVED] Can't click button and Properties doesn't show up
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2015, 06:57 PM
  4. [SOLVED] Suppress msgbox and userform.show
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2014, 05:38 AM
  5. Code a Command Button on UserForm not to close upon click - Excel VBA
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-14-2012, 02:20 PM
  6. [SOLVED] How to open msgBox and close UserForm if no data found
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2012, 04:45 AM
  7. [SOLVED] Close userform with submit button click
    By mrapes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 11:53 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