Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-18-2018, 03:46 AM
Debaser's Avatar
Debaser Debaser is offline How to autofilter by exact date? Windows 7 64bit How to autofilter by exact date? 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write if condition for AutoFilter to check ..? LearnerExcel Excel Programming 1 05-05-2018 08:53 AM
Autofilter on two Date Columns OTPM Excel Programming 3 04-29-2014 12:56 AM
How to autofilter by exact date? How to count even exact date 90 days redza Excel 1 09-17-2013 03:36 AM
How to autofilter by exact date? Sum on AutoFilter Grasshopper Excel 3 02-14-2013 01:41 AM
How to autofilter by exact date? AutoFilter Criteria3 coxjamd Excel Programming 2 01-17-2013 02:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft