ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   filter error (https://www.excelbanter.com/excel-programming/351901-filter-error.html)

x taol

filter error
 


date filter error
the current sheet is following(format "yyyy-mm")
a column
mydt
2000-04
2000-04
2000-04
2000-05
2000-05
2000-06
but the real value(value in formula box)
a column
mydt
2000-04-01
2000-04-01
2000-04-01
2000-05-01
2000-05-01
2000-06-01

i want to filter 2000-05 only using macro.
the folowing code .... not work
sub ex()
set rng=range("a1:a7")
rng.autofilter
rng.autofilter 1, format(cdate("2000-05-01"),"yyyy-mm")
end sub

*** Sent via Developersdex http://www.developersdex.com ***

Karthik Bhat - Bangalore

filter error
 
Hi

Use this code

sub ex()
set rng=range("a1:a7")
rng.autofilter
rng.AutoFilter 1, Criteria1:="2000-05"
end sub

Thanks
Karthik Bhat



All times are GMT +1. The time now is 02:26 PM.

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