Linking Multiple Check Boxes Together

Swins

New Member
Joined
Jul 28, 2015
Messages
7
Hi All

I have a Office 365 spreadsheet with 23 check boxes for categories for sweets (the check boxes either hide or show a row in another sheet).

I also want to add a couple of check Boxes that will select all the "chocolate" (checkbox 24) sweets and deselect the remainder or select all the "Boiled Sweets" (Checkbox 25) and then deselect the remainder.

Also i want to only be able to check either Chocolate or Boiled Sweets (checkbox 24 & 25).

Any Suggestions??? and I hope I have expalined myself well enough

Thanks
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Re: HELP! with Linking Multiple Check Boxes Together

Hello,

Something on the lines of

Code:
    ActiveSheet.Shapes.Range(Array("Check Box 1", "Check Box 3", "Check Box 4")).Select
    With Selection
        .Value = 1
    End With
    ActiveSheet.Shapes.Range(Array("Check Box 5", "Check Box 7", "Check Box 9")).Select
    With Selection
        .Value = 0
    End With

You will need to change the name of the check boxes to suit, and add all of the others.

Not sure what you mean by 'Also i want to only be able to check either Chocolate or Boiled Sweets (checkbox 24 & 25).'

If you mean that you don;t want to select all the Chocolate ones then something like this perhaps?

Code:
    MY_ANS = MsgBox("Do you want to select all chocolate?", vbYesNo, "CHOICE")
    If MY_ANS = vbYes Then
        ActiveSheet.Shapes.Range(Array("Check Box 1", "Check Box 3", "Check Box 4")).Select
        With Selection
            .Value = 1
        End With
        ActiveSheet.Shapes.Range(Array("Check Box 5", "Check Box 7", "Check Box 9")).Select
        With Selection
            .Value = 0
        End With
    End If
 

Swins

New Member
Joined
Jul 28, 2015
Messages
7
Re: HELP! with Linking Multiple Check Boxes Together

Thanks that is exactly what I was after
 

Watch MrExcel Video

Forum statistics

Threads
1,127,536
Messages
5,625,389
Members
416,099
Latest member
sudarsan23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top