title: What code is required to format cells based on dates and adjacent text
body: <p>I am struggling to code cello formats through VBA, I was struggling to do what is required through conditional formatting.</p>
  <p>Firstly, I require any cells with a date occurring within 1 month of the current date to be filled orange. Secondly, any cells with a date before the current date to be filled red. I was able to achieve this easily with conditional formatting.</p>
  <p>The next step is where I thought VBA may be easier. If a check mark appears in the cell adjacent to a date cell, then the date cell (and check mark cell) is to be filled green. I couldn't get something this specific to work with conditional formatting.</p>
  <p>Examples of what I am trying to achieve are shown in the attached image.</p>
  <p>The macro I was working on is below, but the logic just fills any empty check mark cells with orange which I understand. I am also struggling to understand the language required for comparing dates.</p>
  <pre><code>Sub green()
  
  For Each Cell In Worksheets(&quot;Base Data&quot;).Range(&quot;F3:P10000&quot;)
    If Cell.Value = ChrW(&amp;H2713) Then
      Cell.Offset(0, -1).Interior.Color = RGB(146, 208, 80)
    ElseIf Cell.Value &lt; (Date + 30) Then
      Cell.Interior.Color = RGB(255, 192, 80)
    ElseIf Cell.Value &lt; Date Then
      Cell.Interior.Color = RGB(255, 0, 0)
    Else
    End If
    Next
    
  End Sub
  </code></pre>
  <p>I then also need to be able to filter any rows containing an orange or red cell using the buttons at the top.</p>
  <p>Any help would be much appreciated.</p>
  <p>Thanks.</p>
  <p><img src="https://i.stack.imgur.com/VHkE7.png" alt="example" /></p>