Check boxes

laingwb

New Member
Joined
Dec 4, 2020
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
I have a series 4 check boxes lined up in a column. Each check box is in a row. I would like to select the first checkbox and have the other 3 check boxes select (check in box) when the first check box is selected. I figured this out from other posts so thank you. However, it will not let me deselect the first checkbox and the other checkboxes will also uncheck. Here is my VBA for form control.

Sub Check_Some_Boxes_Form_Control()
With ActiveSheet
.Shapes("De-Activate SAT").ControlFormat.Value = xlOn
.Shapes("CareTrack 4 YR Subscr").ControlFormat.Value = xlOn
.Shapes("ActiveCare Direct 1 YR Subscr").ControlFormat.Value = xlOn
End With
End Sub

I assigned this macro to the first checkbox which is called "caretrack". When I select the caretrack checkbox then the above works. It will not let me deselect caretrack and thus the other checkboxes will not deselect. Can someone help me get through this.

Caretrack Subscription Advanc
##
De-Activate SAT##
CareTrack 4 YR Subscr##
ActiveCare Direct 1 YR Subscr##
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi @laingwb, welcome to MrExcel.
How about ...

VBA Code:
Sub Check_Some_Boxes_Form_Control()
  With ActiveSheet
    .Shapes("De-Activate SAT").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
    .Shapes("CareTrack 4 YR Subscr").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
    .Shapes("ActiveCare Direct 1 YR Subscr").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
  End With
End Sub
 
Upvote 0
Solution
Hi @laingwb, welcome to MrExcel.
How about ...

VBA Code:
Sub Check_Some_Boxes_Form_Control()
  With ActiveSheet
    .Shapes("De-Activate SAT").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
    .Shapes("CareTrack 4 YR Subscr").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
    .Shapes("ActiveCare Direct 1 YR Subscr").ControlFormat.Value = .Shapes("Caretrack").ControlFormat.Value
  End With
End Sub
This really worked well so thank you very much. I have one more question and I think I'm close but not there yet. I want select a checkbox and have it unselect another check box. So say I want the chicken with rice dinner. However I want onion rings instead of rice so I select onion rings and the rice check box unselects. The standard dinner has the chicken checkbox and rice checkbox selected. Likewise if I unselect onion rings the rice will select again.
 
Upvote 0

Forum statistics

Threads
1,214,577
Messages
6,120,359
Members
448,956
Latest member
Adamsxl

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
Back
Top