I have a spreadsheet that I'm looking to filter on two criteria: Date created and date changed, the format for Date created is YYYYMM
This is the code I'm trying to use:
The issue I have is that this works fine as long as the second criterion is "=", but if I change it to ">=" then everything is filtered out even though there are entries that are definitely >= LastCreated, but I don't know what I'm doing wrong, or why I'm getting this behaviour. Can anyone give me any pointers on how this is working/why it's not working as I intended?Dim LastCreated As String
LastCreated = Application.InputBox("Enter required 'created month' in format YYYYMM")
'filter on change date = blank and created date = LastCreated
With Worksheets("Filtered").Range("A1")
.AutoFilter field:=26, Criteria1:=""
.AutoFilter field:=5, Criteria1:=">=" & LastCreated
End With
Bookmarks