title: countifs criteria range is more than vba
body: <p>This is simple, it works when i type the function into excel, but not when i run it through VBA</p>
  
  <p>what am i missing from this VBA?
  It has 3 criteria ranges and criterias</p>
  
  <p>the first 2 criteria are for a date range (more than 10th less than 15th, for example)
  the 3rd criteria is to count the number of entries in that date range for a value</p>
  
  <p>When i run the function within excel, i get the correct answer of 400, but i get 0 when run through VBA?</p>
  
  <pre><code>.Cells(9, 4).Formula = Application.WorksheetFunction.CountIfs(Sheets("Sheet1").Range("F8:F1000000"), " &gt;= " &amp; Sheets("Sheet2").Range("D10"), Sheets("Sheet1").Range("F8:F1000000"), " &lt;= " &amp; Sheets("Sheet2").Range("H10"), Sheets("Sheet1").Range("D8:D1000000"), "TestSearch")
  </code></pre>
  
  <p>Will appreciate any guidance, thank you :)</p>