ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofilter with vba wont dispay filtered data (https://www.excelbanter.com/excel-programming/301595-autofilter-vba-wont-dispay-filtered-data.html)

PPesola

Autofilter with vba wont dispay filtered data
 
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



Tom Ogilvy

Autofilter with vba wont dispay filtered data
 
Try

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

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
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






All times are GMT +1. The time now is 05:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com