title: VBA: If cell format is date then do something
body: <p>I have a problem setting conditions for a macro.
  It should do: </p>
  
  <p><code>If CELL_A is * **AND** CELL_B is **DATE** then....</code> </p>
  
  <pre><code>    Sub kontrolafyzprav()
  
  radek = 4
  
    With List1
  
      Do While .Cells(radek, 3) &lt;&gt; ""
          If .Cells(radek, 3) = "DOM" And .Cells(radek, 7).NumberFormat = "General" Then
              .Cells(radek, 3).Interior.Color = RGB(255, 150, 150)
              .Cells(radek, 7).Interior.Color = RGB(255, 150, 150)
  
          ElseIf .Cells(radek, 3) = "MO" And .Cells(radek, 7).NumberFormat = "d/m/yyyy" Then
              .Cells(radek, 3).Interior.Color = RGB(255, 150, 150)
              .Cells(radek, 7).Interior.Color = RGB(255, 150, 150)
                      ' :(    :(     :(     :(
  
          End If
                  radek = radek + 1
      Loop
  
    End With
  
  End Sub
  </code></pre>
  
  <p>In the line with <code>ElseIf .Cells(radek, 3) = "MO" And .Cells(radek, 7).NumberFormat = "d/m/yyyy" Then</code> i tried like everything I could think of.</p>
  
  <p>The first set of conditions works great but I can't get the second one :/</p>
  
  <p>Any help?</p>