+ Reply to Thread
Results 1 to 4 of 4

Need help with checkbox's and macros!

  1. #1
    Registered User
    Join Date
    05-02-2011
    Location
    Northampton
    MS-Off Ver
    Excel 2010
    Posts
    8

    Need help with checkbox's and macros!

    Good afternoon,

    I am new to VBA but I have managed to create quite a good macro sheet as a productivity tool for my work. However, I have put some check boxes (excel not activeX) onto my sheet. I would like a code/macro that will bring up a pop up box with the question "Are you sure?" and options yes/no every time the checkbox becomes TRUE. I need it to only bring up this box when the box is ticked, not when it is unticked?

    Hope someone can help?

    Thanks,

    Ollie

  2. #2
    Registered User
    Join Date
    06-03-2006
    Location
    Rio de Janeiro
    MS-Off Ver
    Microsoft Office 365
    Posts
    41

    Re: Need help with checkbox's and macros!

    Dear Olie,

    I think the best way is to use ActiveX Check Box. In the event CheckBox1_Click() test if the checkbox is true and, if positive, use msgbox with option yes/no.

    Good luck,
    Marcelo Rychter

  3. #3
    Registered User
    Join Date
    05-02-2011
    Location
    Northampton
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need help with checkbox's and macros!

    OK, so I have input this code

    If MsgBox("Are you sure?", vbYesNo) = vbNo Then Exit Sub

    and it seems to do what I want it to do, however it continues to check the box even if you click no on the confirmation screen. Know where I have gone wrong?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Need help with checkbox's and macros!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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