title: Extracting data between to dates and paste to new sheet
body: <p>I have some excel files which each contain 3 rows of data for each single day of the year (date (A1), AVG (B1), CV (C1)) for last 30 years. Now, I want to divide them by the year that they've been collected (e.g. last 20 years, last 10 years, last year, or even last 6 months). So, I use few lines to put the start and end date in two cells and filter out the data (cells) between these two dates.</p>
  
  <pre><code>Dim lngStart As Long, lngEnd As Long
  lngStart = Range("E1").Value 'assume this is the start date
  lngEnd = Range("E2").Value 'assume this is the end date
  Range("A2:A4000").AutoFilter field:=1, _
      Criteria1:="&gt;=" &amp; lngStart, _
      Operator:=xlAnd, _
      Criteria2:="&lt;=" &amp; lngEnd
  </code></pre>
  
  <p>`</p>
  
  <p>And add few more lines to copy those data to a new sheet.</p>
  
  <pre><code>`Range("A1:C1").Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.Copy
  Sheets.Add After:=Sheets(Sheets.Count)
  ActiveSheet.Paste´
  </code></pre>
  
  <p>But, I have several of these worksheets and I have to make a separate sheet for last 30years, 20y, 10y, 5y, 3y, 1y, 6months, 3m and 1month in each worksheet.
  I wonder if is there any chance to have a macro to extract all these time periods (e.g. last 10y according to the last date in database) and copy them to the new sheet labeled by its own specific time period (e.g. "10y")at once!?
  So, the results would be 9 new labeled sheets, each with three columns (date (A1), AVG (B1), CV (C1))!
  Sorry for the long story :)<br>
   Thanks a lot for your help, and looking forward to hearing from you guys!</p>
  
  <p>Best,
  Neos116</p>