Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: worksheet_change / userform close

  1. #11
    New Member
    Join Date
    Mar 2010
    Location
    UK - South Yorkshire
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: worksheet_change / userform close

    Hi

    Didn't want to open new topic
    as my question has to do with close user form and thought to ask here!

    I use this code:

    Private Sub cmdClose_Click()
    Unload Me
    End Sub
    How would add some code, to actually say
    "Are you sure you want to close" Yes / NO
    when clicking CLOSE button

    Thanks

  2. #12
    Board Regular
    Join Date
    Jul 2009
    Location
    Lancashire, England
    Posts
    1,249
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: worksheet_change / userform close

    Hello

    Maybe something like this.

    Code:
    Private Sub cmdClose_Click()
        Dim ans As Integer
        ans = MsgBox("Are you sure you want to close ", vbYesNo)
        If ans = vbNo Then Exit Sub
    Unload Me
    End Sub
    HTH
    Brian.

    - Posting guidelines, forum rules and terms of use

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes

    Xl 2007 & 2010 Win 7

  3. #13
    New Member
    Join Date
    Mar 2010
    Location
    UK - South Yorkshire
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: worksheet_change / userform close

    HAH :D

    That code works as a charm.

    Cheers Mate

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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