View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Filtering a Date Range

Ah, those field numbers start with the first column that's in the filtered
range.

So if you applied filters to A1:X999, then M would be field 13.

"Leslie P via OfficeKB.com" wrote:

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


--

Dave Peterson