I have a spreadsheet that pulls line items in with check boxes for each line item. I would like to put a check box at the top that will select and deselect all the other check b
Sub SelectAllCheckBox()
Dim CB As CheckBox
For Each CB In ActiveSheet.CheckBoxes
If CB.Name <> ActiveSheet.CheckBoxes("Check Box 1").Name Then
CB.Value = ActiveSheet.CheckBoxes("Check Box 1").Value
End If
Next CB
End Sub
Second part:
Dim CB as CheckBox, n as long, x as long
n = ActiveSheet.CheckBoxes.Count
For x = n to 1 Step -1
Set CB = ActiveSheet.CheckBoxes(x)
If CB.Name <> "Check Box 1" Then CB.Delete
Next x