title: Set conditional formatting expression using VBA variables?
body: <p>I am trying to add conditional formatting to a range from VBA using the following statement:</p>
  
  <pre><code>r.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($AYQ4&lt;=D$3;$AYR4&gt;=D$3)"
  </code></pre>
  
  <p>Now the problem is that instead of having AYQ, 4, D, 3 and AYR I have the following VBA variables:</p>
  
  <pre><code>lDatesAndHeadersRow = 3
  the first row of range r = 4
  
  the first column of range r = D
  lStartDateCol = column number of AYQ
  lEndDateCol = column number of AYR
  </code></pre>
  
  <p>Is there any way for me to use my VBA variables instead of normal cell references in the following expression <code>Formula1:="=AND($AYQ4&lt;=D$3;$AYR4&gt;=D$3)"</code>?</p>