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

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,278
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
 

Forum statistics

Threads
1,082,021
Messages
5,362,719
Members
400,686
Latest member
Aakash

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top