Hi everyone! I'm new to VBA so I apologize if this is a silly question. I'm trying to have Excel apply filters to a range based on an array that I have previously defined. I want only rows that have one of the array members in column A to be visible.
ActiveSheet.Range(alldata).AutoFilter Field:=1, Criteria1:=team, Operator:=x1FilterValues
In this case, alldata is my range, previously defined. "team" is my array, also previously defined. When I run the macro, I get a "Run-time error 1004 AutoFilter method of Range class failed" error. If I remove the "Operator:=x1FilterValues" and add a (1) next to my "team" array, the code runs perfectly, but of course it only filters for the first member of the array - I need it to show me all members of the array. So, this leads me to believe that the "alldata" and "team" variables are defined correctly and the problem is with the "Operator".
So, how can I fix this? Thanks in advance for any assistance!
Bookmarks