Setting autofilter criteria

P

peterDavey

G'day all,
I'm tryung to write some code that will set the value of criterion1 for a
date column in an Excel 97 table. When I recorded this action I got the
following code:

Selection.AutoFilter Field:=3, Criteria1:="01-Jun-04"

and it works OK. If I then run this macro it hides all rows. I suspect
that it might have something to do with date handling. Any suggestions will
be greatly appreciated.

cheers
peterDavey
Austin Health
Melbourne
 
F

Frank Kabel

Hi
not tested but try

Selection.AutoFilter Field:=3, Criteria1:= _
Dateserial(2004,6,1)
 
Top