RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 810
- Office Version
- 365
- Platform
- Windows
I've got this code which is supposed to filter column 13 between two dates:
The dates are "dd/mm/yyyy" formatted, and as an example they are "01/09/2019" and "01/12/2019" so a 3 month range.
When the filter is applied, it looks like I'm getting dates between "09/01/2019" and "12/01/2019" - a 3 day range instead.
I've tried playing around with Format(DateValue(Newindate),"dd/mm/yyyy") but it isn't working, I always get the same result. The variables are declared as such:
Code:
ActiveSheet.Range("A2:AI" & LastrowPP).AutoFilter Field:=13, Criteria1:=">=" & DateValue(Newindate), Criteria2:="<=" & DateValue(NewOutDate)
The dates are "dd/mm/yyyy" formatted, and as an example they are "01/09/2019" and "01/12/2019" so a 3 month range.
When the filter is applied, it looks like I'm getting dates between "09/01/2019" and "12/01/2019" - a 3 day range instead.
I've tried playing around with Format(DateValue(Newindate),"dd/mm/yyyy") but it isn't working, I always get the same result. The variables are declared as such:
Code:
Newindate = Format(DateValue(InDate.Caption), "dd/mm/yyyy")
NewOutDate = Format(DateValue(OutDate.Caption), "dd/mm/yyyy")