• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter the Excel based on yesterday date

vamshikrishna

New Member
Hello Team

I have some data in excel and wanted to filter the data based on yesterday date, i want it to happen by writing macro, can you help me
 
vamshikrishna
eg A-column has dates.
You could continue from this ...
Code:
Sub Filter_Yesterday()
    With ActiveSheet
        .Range("A:B").AutoFilter
        .Range("A:B").AutoFilter Field:=1, Criteria1:=xlFilterYesterday, Operator:=xlFilterDynamic
    End With
End Sub
 
Hi

thank for the post, my requirement is like below
i have the data in excel like 9/10/2018, 9/11/2018, 9/13/2018
considering today is 9/14/2018, i want to filter the date of 9/13/2018
 
vamshikrishna
eg A-column has dates.
You could continue from this ...
Code:
Sub Filter_Yesterday()
    With ActiveSheet
        .Range("A:B").AutoFilter
        .Range("A:B").AutoFilter Field:=1, Criteria1:=xlFilterYesterday, Operator:=xlFilterDynamic
    End With
End Sub


Hi

thank for the post, my requirement is like below
i have the data in excel like 9/10/2018, 9/11/2018, 9/13/2018
considering today is 9/14/2018, i want to filter the date of 9/13/2018
 
vamshikrishna
... hmm? org was wanted to filter the data based on yesterday date
Isn't today ... current day and yesterday ... one day before today?
Now, You would like to name 'today' to any day and filter 'one day before Your named day' ... or how?
> You should upload a sample file
which would also show
how You would give 'Your today'?
 
vamshikrishna
... hmm? org was wanted to filter the data based on yesterday date
Isn't today ... current day and yesterday ... one day before today?
Now, You would like to name 'today' to any day and filter 'one day before Your named day' ... or how?
> You should upload a sample file
which would also show
how You would give 'Your today'?

Hi
U can see the attached file i want to filter yesterday date
 

Attachments

  • TEST.xlsx
    28.5 KB · Views: 3
vamshikrishna
As answered in #2 Reply.
..
Now, Your A-column has date & time ... no matter!
It works as You asked ... i want to filter yesterday date
Press the button
 

Attachments

  • TEST.xlsb
    23.7 KB · Views: 11
Back
Top