filter error

  • Thread starter Thread starter x taol
  • Start date Start date
X

x taol

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
 
Hi

Use this code

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

Thanks
Karthik Bhat
 

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

Back
Top