View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Leslie P via OfficeKB.com Leslie P via OfficeKB.com is offline
external usenet poster
 
Posts: 3
Default Filtering a Date Range

I got it to work, I had to change the fields to 13 and 16, my excel won't
except it any other way. Thanks for all your help!!! :)

Leslie

Dave Peterson wrote:
Dates don't always play nice with autofilters. Sometimes, this'll work:

Sub SetFilter()
Range("M1").AutoFilter Field:=1, Criteria1:="<=" & clng(date)
Range("M1").AutoFilter Field:=4, Criteria1:="=" & clng(date)
End Sub

Thanks for your help, but when I tried it out, it ended up deleting all rows..
. Is there a specific format that my dates need to be in to go along with

[quoted text clipped - 36 lines]
Thanks,
Leslie




--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200508/1