• 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.

How to disable Checkboxes if one is checked and when unchecked enable them again?

Lizzz

New Member
The idea is that if we check out one of the "Main checkboxes", those are 1,2,3,4...
For exaple, let's say box 1 is checked then we should get the options 2a,2b,3a,3b,4a,4b disabled. And that is how it should work for the rest of the main boxes, which should also go back to be enable when we uncheck the selected option. Attached you will find the example.

I really appreciate the help, since I am really new with macro topics :)

Kind Regards everyone!
 

Attachments

  • SampleForum.xlsx
    15.8 KB · Views: 2
Hi Lizzz!
Why not use Option Buttons instead of Check Boxes?
Give a look at the attached file.
Regards!
 

Attachments

  • SampleForum.xlsx
    30.1 KB · Views: 2
Hi Lizzz!
Why not use Option Buttons instead of Check Boxes?
Give a look at the attached file.
Regards!
'Hi there!
Thank you for the response. But how could I make it work if the "main option" shows a range of rows, and what the secunday boxes do is to filter some of them. So when 1 is selected it has to be posible to select 1a and 1b at the same time.
'Thanks again, regards!
 
Last edited:
Hi, Lizzz!

Maybe I misunderstood your requirement. Let's start again.

Check Boxes allow to enable more than one at the same time, while Option Buttons allow only one, that's to say if you check one all the others get unchecked.

So with a combination of both controls I think you can achieve your goal, but it will require a bit of VBA code.

Check the uploaded .xlsm file.

Regards!
 

Attachments

  • SampleForum.xlsm
    53.3 KB · Views: 2
Hi, Lizzz!

Maybe I misunderstood your requirement. Let's start again.

Check Boxes allow to enable more than one at the same time, while Option Buttons allow only one, that's to say if you check one all the others get unchecked.

So with a combination of both controls I think you can achieve your goal, but it will require a bit of VBA code.

Check the uploaded .xlsm file.

Regards!


It looks excactly how I want it too look, I will try it out and add it to my code.
You rock, a thousand thanks.

Regards,
Elizabeth.
 
Hi, Lizzz!
Glad you solved it. Thanks for your feedback and welcome back whenever needed or wanted.
Regards!
 
Hi, Lizzz!
Glad you solved it. Thanks for your feedback and welcome back whenever needed or wanted.
Regards!

Just one more question, does the group box play a roll? And I have written my code in the Module section, should it move it to the sheet code area?

Thanks again!

Regards.
 
Hi, Lizzz!
It groups different sets of Option Buttons, check the re-uploaded file.
About the code, as it is code run in response to events of controls that are in a worksheet, it must be placed in the worksheet object module and not in standard modules. If you choose to keep the _Click() Sub...End Sub in the worksheet code (mandatory) and move the inner code to a standard module, within the moved procedures you should qualify the reference to the option buttons or check boxes adding the host worksheet:
Code:
Worksheets("Tabelle1").CheckBox1a.Enabled = TrueOption
Regards!
 

Attachments

  • SampleForum.xlsm
    63.8 KB · Views: 4
Back
Top