How to click all the checkboxes as true

gwandalf

New Member
Joined
Feb 16, 2011
Messages
30
Hi!!! First of all, thanks in advanace for your time and answers.

I dont really know how to manage to make all my checkboxes "true" in one go, due to my code.

I was wondering that maybe with the "GroupName" I could try but I dont know the way

I have three different checkboxes, which are in different sheets:

chkA1, chkA2, ...chkA10 (Sheet1)
chkB1,..............chkB10 (Sheet2)
chkC1,..............chkC10 (Sheet3)

I would like to click all of them in one go. I mean. In my code which is shown a part below this lines, I manage to make it true, but no to click the box, which is what I am looking for. Could you help me, please? It doesnt need to be like this, if you have any other option it would be fine.

Dim boxA(i) as Boolean
Dim boxB(i) as Boolean
.....


boxA(1) = Sheet1.ChkA1.Value
....
boxA(10) = Sheet1.ChkA10.Value
boxB(1) = Sheet1.ChkA1.Value
....
boxB(10) = Sheet1.ChkA10.Value

For i=i To 10
boxA(i) = "True"
boxB(i) = "True"
....
next i
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Here's one way (if I understand you correctly).
There may be better ways.

I've just done a simple version for two tick boxes, one on each sheet, where the cell link for each tick box is cell A1 on the relevant sheet (they can be on different sheets).

Code:
    Sheets("Sheet1").Range("A1").FormulaR1C1 = "1"
    Sheets("Sheet2").Range("A1").FormulaR1C1 = "1"
 
Upvote 0
Assuming your check boxes are in a userform:

Code:
Private Sub CommandButton1_Click()
    For Each Control In Me.Controls
        Control.Value = True
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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