View Single Post
 
Old 06-18-2018, 03:46 AM
Debaser's Avatar
Debaser Debaser is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

It is generally safer with dates and filters to convert to numeric values - for example:

Code:
.AutoFilter Field:=12, Criteria1:=">=" & CDbl(STARTDATE), operator:=xlAnd, criteria2:="<=" & CDbl(STARTDATE)
This assumes that STARTDATE is a Date type variable. If not, you can convert that using CDate like this:

Code:
.AutoFilter Field:=12, Criteria1:=">=" & CDbl(CDate(STARTDATE)), operator:=xlAnd, criteria2:="<=" & CDbl(CDate(STARTDATE))
Reply With Quote