Im trying to run a macro which will pick date A and Date B and give me the data inbetween the 2 dates. Im using the below macro, but doesnt seem to work on the line in which starts the autofilter
Sub DateSelection()
'
'This macro will ask for the date from an input box'
'
Dim mycriteria As String
mycriteria = Range("A1").Value
Dim firstdate As String
firstdate = Range("A11").Value
Sheets("Sheet3").Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:"=>mycriteria", Operator:=xlAnd" _
, Criteria2:"=<firstdate"
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("sheet1").Select
End Sub
Sub DateSelection()
'
'This macro will ask for the date from an input box'
'
Dim mycriteria As String
mycriteria = Range("A1").Value
Dim firstdate As String
firstdate = Range("A11").Value
Sheets("Sheet3").Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:"=>mycriteria", Operator:=xlAnd" _
, Criteria2:"=<firstdate"
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("sheet1").Select
End Sub