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##
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
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
 
Solution

laingwb

New Member
Joined
Dec 4, 2020
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,265
Messages
5,600,605
Members
414,393
Latest member
Vignesh Mechz

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