Checkbox Mania

dgeorge

New Member
Joined
Oct 3, 2017
Messages
10
I currently have 9 ActiveX checkboxes (checkbox1 thru 9) that when clicked preform a copy/paste values command (to remove formulas and keep data) and when unclicked copies the formulas back if needed. See below. These work perfectly as is. I'm trying to create an additional checkbox that will check all 9 of the checkboxes but still allow me to uncheck one or more if necessary.

Here is the code for one of the 9 checkboxes:

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
Range("C3:I4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("M3").Select
End If
If CheckBox1.Value = False Then
Range("C31:I31").Select
Selection.Copy
Range("C3:I4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("M3").Select
End If

End Sub

Please help with the creation of a "master checkbox" that will check all 9 boxes or uncheck all 9 boxes while allowing me to uncheck or check any of the 9 individually.

Thanks!!!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try this:
When you check or uncheck Checkbox10 Checkbox 1 to 9 will be checked or unchecked
Did not know how to loop through Activex Checkboxes. But this works.
Code:
Private Sub CheckBox10_Click()
'Modified 5/31/18 5:20 PM EDT
CheckBox1.Value = CheckBox10.Value
CheckBox2.Value = CheckBox10.Value
CheckBox3.Value = CheckBox10.Value
CheckBox4.Value = CheckBox10.Value
CheckBox5.Value = CheckBox10.Value
CheckBox6.Value = CheckBox10.Value
CheckBox7.Value = CheckBox10.Value
CheckBox8.Value = CheckBox10.Value
CheckBox9.Value = CheckBox10.Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,559
Messages
6,114,302
Members
448,564
Latest member
ED38

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