Hello. My current filter is this:
'Select all the data
Range(Cells(1, 1), Cells.SpecialCells(xlCellTypeLastCell)).Select
'Apply filter
With Selection
.AutoFilter Field:=9, Criteria1:=StaffArray, Operator:=xlFilterValues
End With
The "StaffArray" contains 29 entries.
What I want is to filter and show whatever is NOT in the staff array. I tried all sorts of syntax like:
.AutoFilter Field:=9, Criteria1:=<>StaffArray, Operator:=xlFilterValues
.AutoFilter Field:=9, Criteria1:=<> &StaffArray, Operator:=xlFilterValues
.AutoFilter Field:=9, Criteria1:="<>" &StaffArray, Operator:=xlFilterValues
But all of them returned errors.
From doing some search, people were mentioning something along the lines of "use a formula column to determine whether to include or exclude the values". Maybe they mean this: create some kind of formula that uses the "StaffArray" and searches the field/column in question, and then creates another array containing the values that are not the same as in "StaffArray"... Am I making any sense? If yes, then how do I do this?
I'm only looking for a solution; i.e. it doesn't have to be optimized to run fast.
Bookmarks