title: VBA Excel CheckBox to select all of some specific Checkboxes on Sheet
body: <p>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.<br>
  I got the code from <a href="http://www.exceltrick.com/how_to/selecting-all-checkboxes-using-a-single-checkbox/" rel="nofollow">This Tutorial</a>.</p>
  
  <p>It worked fine until i copied the Code into the second Column.<br>
  When Activating the first or the Second "Master" CheckBox it activates ALL CheckBoxes.<br>
  The First "Master" CheckBox is called "MCB1" the Second is in a Copy of this Code (with another Sub Name) and is Called MCB2.</p>
  
  <p>Here's my Code:  </p>
  
  <pre><code>Sub SelectAll_Read()
  Dim CB As CheckBox
   For Each CB In ActiveSheet.CheckBoxes
    If CB.Name &lt;&gt; 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 &lt;&gt; ActiveSheet.CheckBoxes("MCB1").Name And CB.Value &lt;&gt; ActiveSheet.CheckBoxes("MCB1").Value And ActiveSheet.CheckBoxes("MCB1").Value &lt;&gt; 2 Then
      ActiveSheet.CheckBoxes("MCB1").Value = 2
  Exit For
     Else
       ActiveSheet.CheckBoxes("MCB1").Value = CB.Value
    End If
  Next CB
  End Sub
  </code></pre>