title: Using VBA to apply conditional formatting to a range of cells
body: <p>I would like to know how to access the column in conditional formatting titled 'Applies To' and input my own conditions.
  I have included a screenshot for better reference.</p>
  
  <p><img src="https://i.stack.imgur.com/mSZaR.png" alt="Applies To column"></p>
  
  <p>My code for adding the syntax in conditional formatting is,</p>
  
  <pre><code>With Selection
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="=" &amp; c.Address &amp; "=TRUE"
    .
    .
    .
  End With
  </code></pre>
  
  <p>I believe the code should be added in there but i just cannot find the correct syntax.</p>
  
  <p><strong>Update :</strong></p>
  
  <p>I updated my code to look like this,</p>
  
  <pre><code>With Range(Cells(c.Row, "B"), Cells(c.Row, "N"))
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="=" &amp; c.Address
    .FormatConditions(1).Interior.ColorIndex = 15 'change for other color when ticked
  End With
  </code></pre>
  
  <p>This would essentially make rows of a specific range relevant to where i placed the checkbox, have their background colour changed.
  The checkbox position is represented by c.Address where 'c' contains the location of the cell that i selected to place my checkbox.</p>