FlintstoneMan
New Member
- Joined
- May 12, 2011
- Messages
- 7
How do I AND together two OR criteria with AutoFilter in Excel 2002? Is there a way to use parentheses and then the Operator:xlAnd? I tried to but it resulted in an error. I am trying to see if a date range in fields 4 and 5 intersects with a date range in the variables. Below is a description of what I am trying to do. The "Operator:=xlAnd" is a placeholder for whatever I need to do to make it work.
With Worksheets("Project Data")
.Cells.AutoFilter Field:=4, Criteria1:=">=" & WeekBeginningDate, Operator:=xlOr
.Cells.AutoFilter Field:=4, Criteria1:="<=" & WeekEndingDate
Operator:=xlAnd
.Cells.AutoFilter Field:=5, Criteria1:=">=" & WeekBeginningDate, Operator:=xlOr
.Cells.AutoFilter Field:=5, Criteria1:="<=" & WeekEndingDate
End With
Thanks for your help.
With Worksheets("Project Data")
.Cells.AutoFilter Field:=4, Criteria1:=">=" & WeekBeginningDate, Operator:=xlOr
.Cells.AutoFilter Field:=4, Criteria1:="<=" & WeekEndingDate
Operator:=xlAnd
.Cells.AutoFilter Field:=5, Criteria1:=">=" & WeekBeginningDate, Operator:=xlOr
.Cells.AutoFilter Field:=5, Criteria1:="<=" & WeekEndingDate
End With
Thanks for your help.