title: Only delete a certain conditional formatting rule using VBA
body: <p>My Excel spreadsheet consists of <strong>different</strong> <code>conditional formatting</code>:</p>
  <hr />
  <p><strong>VBA-Code:</strong></p>
  <pre><code>Sub Apply_Conditional_Formatting()
  With Sheet1.Range(&quot;=$A$1:$C$7&quot;)
      .FormatConditions.Add Type:=xlExpression, Formula1:=&quot;=$A1=$F$1&quot;
      .FormatConditions(.FormatConditions.Count).Interior.Color = RGB(255, 255, 0)
  End With
  End Sub
  </code></pre>
  <hr />
  <p><strong>Conditioal Formatting Rules Manager:</strong> <br>
  <em>(Sorry for only having it available in German)</em></p>
  <p><a href="https://i.stack.imgur.com/jdl78.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jdl78.jpg" alt="enter image description here" /></a></p>
  <hr />
  <p>Now I am looking for a <code>VBA</code> that <strong>identifies</strong> the second <code>conditional formatting</code> (the one that I apply with the VBA code above) and deletes it. The other <code>conditional formatting</code> should remain.</p>
  <hr />
  <p>With the below <code>VBA</code> all <code>conditional formatting</code> rules get deleted:</p>
  <pre><code>Sub Delete_Conditional_Formatting()
  sheet1.Range(&quot;$A$1:$C$7&quot;).FormatConditions.Delete
  End Sub
  </code></pre>
  <p>What do I need to change in the code to <strong>only delete</strong> the second <code>conditional formatting</code>?</p>