Sub FilterByDate()
Dim ws As Worksheet
With ActiveSheet
Dim c1 As Long: c1 = .Range("X1").Value 'from date
Dim c2 As Long: c2 = .Range("Z1").Value 'to date
On Error Resume Next: .ShowAllData: On Error GoTo 0
'filter the data
.Range("A1").AutoFilter
.Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:=">=" & c1, Operator:=xlAnd, Criteria2:="<=" & c2
.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
'paste data to new sheet
Set ws = Sheets.Add
ws.Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths
ActiveSheet.Paste
End With
End Sub