-
Help with filter by date
I am trying to filter for dates before today. However, my code below is just simply not working. It runs but it does not seem to be filtering. Anybody know whats wrong with the code below? Thanks!
Sheets(1).Range("A1:AC1").AutoFilter Field:=11, Criteria1:="<" & CLng(Date)
-
May be those lines help you (Not Testes)
Code:
Dim myDate As Date
myDate = DateSerial(Year(myDate), Month(myDate), Day(myDate))
Sheets(1).Range("A1:AC1").AutoFilter Field:=11, Criteria1:="<" & myDate
-
-
I tried using your code above. It kind of spits out the same results. I think it sort of skips over that line without doing anything.
-
I double checked and as it turns out your code actually works just fine. I just made a small organization error. Thanks!
-
You're welcome. Glad I can offer some help