i have recorded a macro and editted so it should filter a table and show anying that is before tomorrows date.
however when I run it it does not give any results.
Oddly if I click the filter arrow and check the details it is all correct and clicking OK gives the results as I expected.
however when I run it it does not give any results.
Code:
Sub overdue()
'
' overdue Macro
'
Dim criteria As Date
criteria = Date + 1
ActiveSheet.Range("$A$1:$P$188").AutoFilter Field:=12
ActiveWorkbook.Worksheets("Active rejects").AutoFilter.Sort.SortFields.Clear
ActiveSheet.Range("$A$1:$P$188").AutoFilter Field:=12, Criteria1:= _
"<" & criteria, Operator:=xlAnd
Sheets("Active rejects").Select
End Sub
Oddly if I click the filter arrow and check the details it is all correct and clicking OK gives the results as I expected.