title: Get Date Autofilter in Excel VBA
body: <p>I am trying to extract Autofilter parameters using VBA.
  Can any one help me with getting the Autofilter parameters, specifically when a date Autofilter is applied?
  E.g. Say you have a table with two columns, one contains text data, and a second contains date data. <br>To set text filter to the first colum:</p>
  
  <pre><code>Range.Autofilter Field:=1, Criteria1=Array("text1","text2","text3","text4"), Operator:=xlFilterValues
  </code></pre>
  
  <p>Then to get the filter information you can loop through the Criteria1 Variant Array (indexed from 1) to get each filter, as in for i = 1 to 4:</p>
  
  <pre><code>Print Range.Autofilter.Filters(1).Criteria1(i)
  </code></pre>
  
  <p>Now for column two say a date filter has been set:</p>
  
  <pre><code>Range.AutoFilter Field:=2, Operator:=xlFilterValues, Criteria2:=Array(2, "8/10/2015", 2, "8/20/2015")
  </code></pre>
  
  <p>If we follow the same logic for the text filter, I'd expect we could get the filter information from a variant array in the Criteria2 property, but this statement will produce an error (1004: Application-defined or object-defined error), whereas you'd expect the integer '2' to be the output:</p>
  
  <pre><code>Print Range.Autofilter.Filters(2).Criteria2(1)
  </code></pre>