This question might be a bit similar to this question but it is not. Intersection of two arrays of ranges
Okay, I am currently working on a project with VBA and I need to filter a table. There are two filters looks like this (a1 and a2 contain strings for filter):
Dim a1() As String
Dim a2() As String
.Autofilter Field:=1, Criterial:=Array(a1)
.Autofilter Field:=1, Criterial:=Array(a2)
So as you notice, the 2nd line of autofilter just overwrites, in a way, the previous filter and this is not the way I would like the filter to behave. I would like to have an array to have mutual elements of a1 and a2 so that I can filter with the mutual elements of two arrays.
How would you intersect two arrays that contain couple of strings? I prefer not to use cells for this purpose just to reduce the worksheets on my workbook.