I have an Excel Sheet with two columns of CheckBoxes of which the first CheckBox of each is the "Master" Checkbox which toggles all other CheckBoxes.
I got the code from This Tutorial.
It worked fine until i copied the Code into the second Column.
When Activating the first or the Second "Master" CheckBox it activates ALL CheckBoxes.
The First "Master" CheckBox is called "MCB1" the Second is in a Copy of this Code (with another Sub Name) and is Called MCB2.
Here's my Code:
Sub SelectAll_Read()
Dim CB As CheckBox
For Each CB In ActiveSheet.CheckBoxes
If CB.Name <> ActiveSheet.CheckBoxes("MCB1").Name Then
CB.Value = ActiveSheet.CheckBoxes("MCB1").Value
End If
Next CB
End Sub
Sub Mixed_ReadState()
Dim CB As CheckBox
For Each CB In ActiveSheet.CheckBoxes
If CB.Name <> ActiveSheet.CheckBoxes("MCB1").Name And CB.Value <> ActiveSheet.CheckBoxes("MCB1").Value And ActiveSheet.CheckBoxes("MCB1").Value <> 2 Then
ActiveSheet.CheckBoxes("MCB1").Value = 2
Exit For
Else
ActiveSheet.CheckBoxes("MCB1").Value = CB.Value
End If
Next CB
End Sub