title: How to check/uncheck all other checkboxes on spreadsheet and hide/unhide some columns?
body: <p>There are 6 checkboxes on the sheet. </p>
  
  <p><strong>1st part:</strong></p>
  
  <p>Each checkbox(except the first one) is used to hide/unhide a column. </p>
  
  <p><strong>2nd part:</strong></p>
  
  <p>The first checkbox checks/unchecks the other checkboxes and when checked it unhides the columns from A to E and when unchecked it hides them. </p>
  
  <p>To sum up:</p>
  
  <pre><code>checkbox-1: check/uncheck other 5 checkboxes and unhide/hide columns A-E
  checkbox-2: hide/unhide column A
  checkbox-3: hide/unhide column B
  checkbox-4: hide/unhide column C
  checkbox-5: hide/unhide column D
  checkbox-6: hide/unhide column E
  </code></pre>
  
  <p>I tried the below code to hide/unhide the columns when checkboxes 2-6 is clicked. It worked. But how will i do the 2nd part? </p>
  
  <pre><code>Sub CheckBox_Click()
  
      Dim vis As Boolean, ac As String, col As String
  
      ac = Application.Caller
  
      With ActiveSheet
  
          vis = (.Shapes(ac).ControlFormat.Value = 1)
  
          Select Case ac
              Case "checkbox-2": col = "A"
              Case "checkbox-3": col = "B"
              ...
          End Select
  
          If col &lt;&gt; "" Then .Columns(col).Hidden = vis
  
      End With
  
  End Sub
  </code></pre>