filtering dates on multiple column crietria

N

news.microsoft.com

I have a table named tbl.
and column2,column3 and column4 are I want to filter on.

column2 and column3 are date-fomatted columns,
and column4 is just text-value column.
I want to filter on "AND" all conditions.


Sub Macro1()
ActiveSheet.ListObjects("tbl").Range.AutoFilter Field:=2, Operator:= _
xlFilterValues, Criteria1:=">=" & Format("2009/03/22", "yyyy/mm/dd")

ActiveSheet.ListObjects("tbl").Range.AutoFilter Field:=3, Operator:= _
xlFilterValues, Criteria1:="<=" & Format("2009/03/25", "yyyy/mm/dd")

ActiveSheet.ListObjects("tbl").Range.AutoFilter Field:=4, Operator:= _
xlFilterValues, Criteria1:="=done"

End Sub

one more,
how to address column with "name" not by column index like "Field:=2"

Thanks.
 

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