see sample data in the file "joben.xls" attached.
sheet 1 has data. sheet2 has result
if your sheet names are different modify the macro suitably.
the macro is in vb editor module1
if you want you can create a button from "form" toolbar (view(menu)-toolbar-form) and assign this macro to that button
note the criteria dates are in F1` and G1 in sheet 1
if different modify suitably
VB:
Sub test()
Dim r As Range, filt As Range, d1 As Long, d2 As Long
With Worksheets("sheet1")
d1 = .Range("F1").Value
d2 = .Range("G1").Value
.Range("A1").CurrentRegion.AutoFilter field:=.Range("A1").Column, Criteria1:=">=" & CDate(d1) _
, Operator:=xlAnd, Criteria2:="<=" & CDate(d2)
Set filt = .Range("a1").CurrentRegion.SpecialCells(xlCellTypeVisible)
With Worksheets("sheet2")
.Cells.Clear
filt.Copy
.Range("a1").PasteSpecial
.Range("A1:B1").EntireColumn.AutoFit
End With
.Range("A1").CurrentRegion.AutoFilter
End With
End Sub
Bookmarks