+ Reply to Thread
Results 1 to 3 of 3

Macro for unchecking checkboxes

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    Reston, VA, US
    MS-Off Ver
    Excel 2003
    Posts
    1

    Macro for unchecking checkboxes

    Hi all-

    I have created a survey using the control toolbox within Excel. In this survey I have several questions that have several checkboxes available for answer selection. I want to add a macro so that if a particular box is checked then all of the other boxes are unchecked. Here is an example:

    Question:
    What type of grass is on your lawn?
    CheckBox 1 = Bent
    CheckBox2 = Bermuda
    CheckBox 3 = None

    I want the user to be able to click on one or both of checkboxes 1 or 2, but when check box 3 is selected it verifies that neither checkbox 1 or 2 is selected. Any thoughts will help.

    Thanks,
    Steve

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for unchecking checkboxes

    You're using the wrong control. You want to use Radio Buttons instead of checkboxes.

    One of the controls in the Radio Buttons allows you to group sets of radio buttons together. Once grouped, only one button in the group can be selected.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for unchecking checkboxes

    EDIT: Sorry, just noticed your last comment about multiple selections. Yes, that would require fancy coding, coding you would have to maintain.

    I suggest you STILL convert to radio buttons and add a 4th option.

    [ ] Option 1
    [ ] Option 2
    [ ] Option 1 & 2 <-----added
    [ ] Option 3

+ 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