+ Reply to Thread
Results 1 to 3 of 3

Userform - Continue and cancel command buttons code

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Userform - Continue and cancel command buttons code

    Hi all,

    I hope someone can help me please?

    I have my userform and currently it goes through my excel document and ticks a check box if the header is there (fantastic!).
    I am hoping to add two command buttons to the end to allow the user to continue with the macro or cancel the macro and return to the workbook but I am struggling with the code I need for this - could someone please advise me on this?

    Below is the code for the check boxes which I will need to add to for my other two buttons.

    Thanks for your help.


    Please Login or Register  to view this content.
    Last edited by Jessica.Bush; 09-01-2010 at 04:43 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform - Continue and cancel command buttons code

    Hi,

    By 'continue with the macro' I assume you mean you want some other macro code to be run..

    Add your two command buttons and use the Click Event.

    In the button for continuing enter

    Please Login or Register  to view this content.
    and in the cancel button use
    Please Login or Register  to view this content.
    and set the Cancel Property of the button to True which will ensure the form is unloaded if the 'X' is clicked or if the {Esc} key is used.

    Obviously change the Module1, UserForm1 to reflect your object names.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Userform - Continue and cancel command buttons code

    Hi Richard,

    Thank you so much for your reply it is fantastic, just what I needed!

    Jessica

+ 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