FlintstoneMan
New Member
- Joined
- May 12, 2011
- Messages
- 7
If I test either field by itself, I get the correct answer. If I xlOr them together as follows, I get the wrong answer. Is this not the correct way to OR them together?
What is the corect way to OR two fields with criteria?
I appreciate any help in getting this to work.
With Worksheets("Date Ranges")
.Cells.AutoFilter Field:=4, Criteria1:=">=" & WeekBeginningDate, Operator:=xlAnd, Criteria2:="<=" & WeekEndingDate, Operator:=xlOr
.Cells.AutoFilter Field:=5, Criteria1:=">=" & WeekBeginningDate, Operator:=xlAnd, Criteria2:="<=" & WeekEndingDate
End With
What is the corect way to OR two fields with criteria?
I appreciate any help in getting this to work.
With Worksheets("Date Ranges")
.Cells.AutoFilter Field:=4, Criteria1:=">=" & WeekBeginningDate, Operator:=xlAnd, Criteria2:="<=" & WeekEndingDate, Operator:=xlOr
.Cells.AutoFilter Field:=5, Criteria1:=">=" & WeekBeginningDate, Operator:=xlAnd, Criteria2:="<=" & WeekEndingDate
End With