title: vba criteria syntax in countifs formula
body: <p>I've got data stored on multiple worksheets in Excel. Each worksheets has the exact same data structure.<br />
  I am trying to make a script, that makes me a nice summery view on another worksheet.<br />
  This worksheet has the worksheet names listed on column 1 and I want to count rows that satisfy specific conditions. I managed to get a <code>countifs</code> function produced that counts rows for which a specific column has the TRUE logical value, but I have date and time values as well, and I want to count ones between two specific dates. What do I get wrong?</p>
  <pre class="lang-vb prettyprint-override"><code>for i = [got the range right here]
      wsOverview.cells(i, 2).Formula = &quot;=countifs(&quot; &amp; ThisWorkbook.sheets(wsOverview.cells(i, 1).value).Range(&quot;AI:AI&quot;).Address(external:=True) &amp; &quot;,&quot;&quot;&gt;&quot;&quot;&quot; &amp; wsOverview.cells(1,2).value &amp; &quot;)&quot;
  next i
  </code></pre>
  <p>(this is an attempt at the date greater than criteria, I don't bother with the maximal date value until i manage to get this right.)</p>
  <p>The problem is somewhere in the last part, because replacing <code>&quot;&quot;&gt;&quot;&quot;&quot; &amp; wsOverview.cells(1,2).value</code> with TRUE and the AIs with the column that has boolean data yields results.</p>