I have an autofilter and in one of the columns there are three main types of value: an employee ID, a name or empty. I need to find the names only.
When you have a pivottable then you can loop trough the items and you can create an if statement to determine if it should be visible or not, is there nothing like that for autofilters?
The column could have employee ID like A123456 or names like Andy, Tom and so on. Because of Andy I can't filter on A*.
I can use this to get all the unique values
aa = Application.WorksheetFunction.Unique(Range("P2:P528").Value)
But when I loop through this list to set the filter it will only set the filter to this specific item, not "add to the list" as you would do manually in Excel
for i = 1 to 10
ActiveSheet.Range("$A$1:$P$528").AutoFilter Field:=16, Criteria1:=aa(i,1)
next i
Can I make the above loop remember the previous just like when you set filters in pivot tables?
EDIT;
I realize I can make a helper column with =isnumber(mid(P2,2,6))
but because I don't know the size of the table (number of columns may vary) I try to avoid this.