+ Reply to Thread
Results 1 to 5 of 5

Enable button only if any checkbox is checked?

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Enable button only if any checkbox is checked?

    I have a user form with 7 checkboxes, named CheckBox1 thru CheckBox7

    The form has a command button, disabled by default, named btnUpdate

    I want to enable the command button only if one or more of the checkboxes is checked. If all the checkboxes become unchecked, I want the command button to become disabled again.

    I can't seem to figure out the logic for this.

    Thanks for helping me.

    Excel 2000
    Last edited by proepert; 04-12-2010 at 10:26 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Enable button only if any checkbox is checked?

    Try this demo workbook, it ony has three checkboxes, but the logic is the same.
    It also demonstrates a toggle all button.

    Have fun!!!!!......

    slainte
    Alistair

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: Enable button only if any checkbox is checked?

    Thanks again, works well.

  4. #4
    Registered User
    Join Date
    07-30-2013
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Enable button only if any checkbox is checked?

    Quote Originally Posted by Marcol View Post
    Try this demo workbook, it ony has three checkboxes, but the logic is the same.
    It also demonstrates a toggle all button.

    Have fun!!!!!......

    slainte
    Alistair

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

    Thank you for the code. Though I have a problem..
    Trying to disable option button if check box is not selected. It works if I "check" and then "uncheck" the check box, but when the form opens initially, the option box is still enabled and can be chosen. My code is below:

    Please Login or Register  to view this content.
    Any suggestions?
    Thanks a lot!
    P
    Last edited by arlu1201; 08-02-2013 at 02:11 PM.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Enable button only if any checkbox is checked?

    npb88,

    Welcome to the forum.

    2 pointers - 1. Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

    2. I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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