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

Dynamic Date Filter

Hi Guys,

I need to filter dynamic date from datas. Below vba code I have used.
But month and date format differs from my data.
Can you pls help me to sort out.


Date format - dd-mm-yyyy given
But this code take date format as - mm-dd-yyyy

eDate : 05-04-2025
ActiveSheet.Range("$A$1:$T$900000").AutoFilter Field:=3, Criteria1:= _"<=" & eDate, Operator:=xlAnd

Thanks in advance.
 
Hi Belleke,

I have date column,

Date:
01/04/2025
02/04/2025
03/04/2025
04/04/2025
05/04/2025
06/04/2025
07/04/2025


i just want to filter
<= 05/04/2025(dd-mm-yyyy) only

but i got a result of all the dates that is includes both 06/04/2025 & 07/04/2025.

Pls correct it. Thanks in advance
 
Hi, according to your code as it is the variable eData should be a Long data type.​
When the date - true Excel date stored as a number so very not as text - comes from a worksheet cell​
so rather than using an useless variable the filter can directly read the cell property Value2 …​
 
Back
Top