• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Allow only 1 section of check boxes to be checked at a time

Countess

New Member
I have 7 sections of check boxes. I’d like to have it where if any check box in section A is selected, check boxes in section B cannot be selected (and vice versa). The check boxes in the other sections are not affected by either and can still be selected no matter what.


Many thanks for the help!
 
Hi Countess..


Normally We use CHECKBOX to select Multiple Otion.. and to select any one of them.. we use.. OPTIONBUTTON or RADIOBUTTON..


Please change 1st two CHECKBOX to OPTIONBUTTON and leave others CHECKBOX untouched..


Please confirm if this is fine..

Otherwise, We have take help of Manual Coding..


Regards,

Deb
 
Hi Deb ,


As far as I can see , using radio buttons will take away from the existing system.


If Checkboxes 1 , 2 and 3 pertain to a certain feature 1 , and Checkboxes 4 , 5 and 6 pertain to another feature 2 , and feature 1 and feature 2 are mutually exclusive , then how do you implement this by using radio buttons ?


What this means is that a selection system which needed two hierarchical levels is being sought to be implemented using only 1 level.


What can be done is to use the Checkbox_Click event macro to ensure that if any of the checkboxes in one set is checked , then all the checkboxes of the other set are disabled ; to gain access to the other set , you will have to uncheck all the checkboxes of one set , so that once again both sets of checkboxes are enabled.


Narayan
 
Hi Countess,


Can you please download the below file and check whether you are looking for this kind of solution.


http://www.2shared.com/document/4h2CISci/book1.html


Thanks,

Suresh Kumar S
 
Thanks everyone for your input. What I gathered is that I cannot do what I wanted to do with the check boxes and there isn’t a way to tie the 2 sections together to make them relative to each other without a macro. So as an alternate, I used conditional formatting and text – so when a check box(or more) in section 1 is select, the section 2 is grayed out and I added a comment “Do not check boxes in this section” (and vice versa). Hopefully this will work well.


However I am curious about the radio/option buttons. Can anyone provide me an example of how they would work in my situation. Basically, was thinking once an option was selected in section 1 then the selections in section 2 would be rendered unelectable somehow/some way.
 
Hi ,


I think you have not read my earlier post !


What you want can be done , through VBA ; is this acceptable to you ?


Narayan
 
Hi Countess.


Insert Two CheckBox's from Developer > Insert > ActiveX Control

Go to Design Mode > View Code..

Use below Code to get the desired result.

[pre]
Code:
Private Sub CheckBox1_Click()
CheckBox2 = Not (CheckBox1)
End Sub

Private Sub CheckBox2_Click()
CheckBox1 = Not (CheckBox2)
End Sub
[/pre]
Regards,

Deb
 
Back
Top