• 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.

How do we filter date and time values such as ‘1/15/2019 4:08:48 PM’ from a range

ThrottleWorks

Excel Ninja
Hi,

How do we filter date and time values such as ‘1/15/2019 4:08:48 PM’ from a range.
I have a range, in this range we have a column for dates.

And I have stored date be filtered in a cell, let us say, cell A1.
And range to filter the dates is B1:B50.
How do I filter value from cell A1 in range B1:B50.

Can anyone please help me in this.

 
ThrottleWorks
Code:
Sub Do_TrottleWorks()
    With ActiveSheet
        dd = Format(.Range("A1"), "m/d/yyyy")
        .Range("$B$1:$B$50").AutoFilter Field:=1, Operator:=xlFilterValues, Criteria2:=Array(2, dd)
    End With
End Sub
 
Back
Top