Poundland
08-20-2008, 04:40 AM
Guys,
Can you help me, I have written some code to filter some data by date.
' Sets the Date criteria for searching
TDate = Format((Now - 2), "dd/mm/yyyy")
' Filters for all receipts that are older than 24 hours
Selection.AutoFilter Field:=7, Criteria1:="<=" & TDate
All data is in the correct format, and when the code is run the filter is activated with the relevant search criteria but nothing is displayed in the data file.
However when I go into the filter manually on the data file, all the coded criteria is correct and when I confirm manually the filtered data is displayed.
Why is the code not automatically displaying the data?
Can you help me, I have written some code to filter some data by date.
' Sets the Date criteria for searching
TDate = Format((Now - 2), "dd/mm/yyyy")
' Filters for all receipts that are older than 24 hours
Selection.AutoFilter Field:=7, Criteria1:="<=" & TDate
All data is in the correct format, and when the code is run the filter is activated with the relevant search criteria but nothing is displayed in the data file.
However when I go into the filter manually on the data file, all the coded criteria is correct and when I confirm manually the filtered data is displayed.
Why is the code not automatically displaying the data?