Link to home
Start Free TrialLog in
Avatar of Justin
Justin

asked on

Auto Filter not picking up data which has Previous day's date

Hi Guys, within an Excel macro, I use the following code which filters Column 12 for a Range called "PrevDay" (which is a Cell which has the Previous Day's Date) but it does not work. What's wrong with the code?

Sheets("PL Star Accrual").Select


    Rows("26:26").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$26:$AZ$242").AutoFilter Field:=15, Criteria1:="0"

    ActiveSheet.Range("$A$26:$AZ$242").AutoFilter Field:=12, Criteria1:=Range("Prevday")
Avatar of Rgonzo1971
Rgonzo1971

Hi,

Could you send a dummy?

Regards
what is there in Column 15 ?
gowflow
pls try ( if they have the same date format)
ActiveSheet.Range("$A$26:$AZ$242").AutoFilter Field:=12, Criteria1:=Range("Prevday").Text

Open in new window

Avatar of Justin

ASKER

Here's a dummy file with Macro
Example1.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Superb?
 Could you comment on your decision to request your answer as the solution
Avatar of Justin

ASKER

Sorry Gonzo, I accidentally did that. How do I restore it so to award you the points?
Avatar of Justin

ASKER

superb