title: VBA Code to filter between a range of dates
body: <p>I'm looking to filter my table on dates based off a user friendly drop down box.</p>
  
  <p>As it stands, the dropdown box is populated by just month names.
  There is then a hidden formula that transfers these names into 2 dates in cells U4 and U5.
  The dates are the first day of the month and last day of month.</p>
  
  <p>I want to be able to select the month and then click a button to filter a list object table below on the dates.</p>
  
  <p>here is my current code:</p>
  
  <pre><code>Sub Filters()
  
      Range("U4", "U5").Copy
      Range("V4").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
              :=False, Transpose:=False`
  
      ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=2, Criteria1:="&gt;=" &amp; Range("V4").Value, Operator:=xlAnd, Criteria2:="&lt;=" &amp; Range("V5").Value, Operator:=xlAnd
  
  End Sub
  </code></pre>
  
  <p>But the filter does not "execute"
  I've copied the cells to V4 and V5 to see if the formulas were anything to do with it, but no joy.</p>