how do i using vba filter a row of data containing dates.
When i set a breakpoint the filter is showing a text string of < 43961 which was converted from code below. If i mouse over the oPDT field it shows a date of "5/10/2020"
Dim myDate as Date
Dim oPDT As String
myDate = "06/09/2020"
oPDT = Format(DateAdd("d", -30, myDate), "MM/DD/YYYY")
.AutoFilter Field:=7, Criteria1:="<" & oPDT
data in column 7
01/01/2019
06/01/2020
02/03/2018
after filtering i would expect to find the 01/01/2019 and 02/03/2018 but nothing is showing up
Thanks
When i set a breakpoint the filter is showing a text string of < 43961 which was converted from code below. If i mouse over the oPDT field it shows a date of "5/10/2020"
Dim myDate as Date
Dim oPDT As String
myDate = "06/09/2020"
oPDT = Format(DateAdd("d", -30, myDate), "MM/DD/YYYY")
.AutoFilter Field:=7, Criteria1:="<" & oPDT
data in column 7
01/01/2019
06/01/2020
02/03/2018
after filtering i would expect to find the 01/01/2019 and 02/03/2018 but nothing is showing up
Thanks