title: vba date filter criteria derived from a cell reference
body: <p>I'm trying to filter data where one filter criteria - month - needs to be entered by the user in a cell on one sheet in the workbook.</p>
  
  <p>If the data is typed into the code, it works fine, as written below:</p>
  
  <pre><code>ActiveSheet.Range("$A$2:$P$2173").AutoFilter Field:=13, Criteria1:=Array( _
      "="), Operator:=xlFilterValues, Criteria2:=Array(1, "10/1/2013")
  ActiveSheet.Range("$A$2:$P$2173").AutoFilter Field:=12, Criteria1:="&lt;&gt;"
  ActiveSheet.Range("$A$2:$P$2173").AutoFilter Field:=3, Criteria1:="&lt;&gt;"
  </code></pre>
  
  <p>The column to be filtered has dates displayed as <code>MM-YYYY</code> but show in the formula bar as <code>DD-MM-YYYY</code>. I haven't been able to replace the date <code>10/1/2013</code> with a variable, cell ref or named range linked to another sheet.</p>
  
  <p>So, data to be filtered is in <code>Sheet1</code> and the month is entered into a cell in <code>Sheet2</code>.</p>
  
  <p>Can someone help with this?</p>