PDA

View Full Version : Solved: Auto filter



gibbo1715
12-19-2005, 05:35 AM
an someone tell me how i can set up my auto filter to filter on more than one criteria or on more than one field?

Tried this but didnt work for me

Sub Testing()
Dim iLastRow As Long

'Find the last row containing data
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
ActiveSheet.Range("A1:F" & iLastRow).AutoFilter Field:=3, Criteria1:="<>A", Criteria2:="<>E"
End Sub

cheers

gibbo

gibbo1715
12-19-2005, 05:55 AM
Selection.AutoFilter Field:=3, Criteria1:="<>E", Operator:=xlAnd, _
Criteria2:="<>B"

seems to work for me

Zack Barresse
12-19-2005, 09:20 AM
Yup, you got it gibbo! In multiple conditions [AutoFilter] you must specify the operator to be used with the two criteria.

Thanks for posting your solution!!