+ Reply to Thread
Results 1 to 4 of 4

VBA User Form - Linking Close Button and Cancel Button

  1. #1
    Registered User
    Join Date
    05-11-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    21

    VBA User Form - Linking Close Button and Cancel Button

    Dear Friends,

    I have created a Userform with following buttons,

    1.Design
    2.Cancel
    3.Help
    4.Clear Form

    During the process if I press Cancel button to Stop execution I have prepared the vba code to request for confirmation. When I click on the "Close" button at the right top corner of the window, it doesn't request any confirmation. In such case, How can I interlink my "Cancel" button and "Close" button.


    Thanks in advance
    Last edited by nivassrii; 05-26-2011 at 07:09 AM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: VBA User Form - Linking Close Button and Cancel Button

    you can add this event in your user form code
    Please Login or Register  to view this content.
    this will display a message whenever you try to terminate the user form

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: VBA User Form - Linking Close Button and Cancel Button

    or you can force the use of the cancel option button
    Please Login or Register  to view this content.
    or run the commandbutton code
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Registered User
    Join Date
    05-11-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: VBA User Form - Linking Close Button and Cancel Button

    Thank you Mohd9876.

+ 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