I am having trouble filtering a column on dates.
I have read much in forums about there being an immediate issue with this unless you are using the American region system format which I'm not.
I have however used a helper comumn to filter on which stores the date serial number rather than a date.
I find that the code will only filter and display the data of the last row if the date (serial) is greater than today's date (serial). If I change the date in a row further up to fit the criteria, that row is ignored.
code snippet below.
If anyone can point me in the right direction, I'd appreciate it.
I hate dates.
I have read much in forums about there being an immediate issue with this unless you are using the American region system format which I'm not.
I have however used a helper comumn to filter on which stores the date serial number rather than a date.
I find that the code will only filter and display the data of the last row if the date (serial) is greater than today's date (serial). If I change the date in a row further up to fit the criteria, that row is ignored.
code snippet below.
Code:
Sub Pending()
Dim SDate As Date
If IsDate(Range("A1")) Then 'establish if a date is in A1
SDate = Range("A1")
SDate = DateSerial(Year(dDate), Month(dDate), Day(dDate))
End If
Dim LDate As Long
Set My_Range = ActiveSheet.Range("A3:Q" & LastRow)
My_Range.select
LDate = SDate
'Set the filter fields and the filter criteria
My_Range.AutoFilter Field:=11, Criteria1:="P" 'shows only ticked cells
My_Range.AutoFilter Field:=17, Criteria1:=">" & LDate
End sub
I hate dates.