Hi, looking at filtering on the previous date, the following says all the right dates, however the filter returns nothing. Please see below
Today (StartDate) is the 21st and EndDate is the 19th
Any help as usual will be greatly rec'd
Excel spreadsheet before filterSub Macro1()Dim StartDate As Date Dim EndDate As Date StartDate = Date EndDate = (Date - 2) Range("A1:D1").Select Selection.AutoFilter ActiveSheet.Range("$A$1:$E$1").AutoFilter Field:=4, Operator:= _ xlFilterValues, Criteria2:=EndDate End Sub
before filter.PNG
spreadsheet after applying code
filter
filter.jpg