Autofilter with vba wont dispay filtered data

G

Guest

When i run autofilter code, range with autofilter is empty! but if i click "(custom...)" in autofilter list and click OK, autofilter shows right values.

my Autofilter code;
Range("a1").AutoFilter Field:=4, Criteria1:=">=27.5.2004", Operator:=xlAnd, Criteria2:="<=3.6.2004"

i'm using Excel 97 with Win XP Pro
 
T

Tom Ogilvy

Try

Range("a1").AutoFilter Field:=4, Criteria1:=">=" & DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

PPesola said:
When i run autofilter code, range with autofilter is empty! but if i click
"(custom...)" in autofilter list and click OK, autofilter shows right
values.
my Autofilter code;
Range("a1").AutoFilter Field:=4, Criteria1:=">=27.5.2004",
Operator:=xlAnd, Criteria2:="<=3.6.2004"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top