Hello,
I sometimes use the Filter function to filter a 1-dimensional array.
The syntax is:
Filter(sourcearray, match, [ include, [ compare ]])
The "match" argument is used to search the string we want.
It seems that we can only search ONE string, say "cat".
Is it possible to search more than one string, say "cat" and "dog"?
How can this be done? In Excel, we can use filters to do this. I wonder if we can do this in VBA.
I tried using a variable to represent "match", like this:
ElseIf opt_1 = True Then
Dim var As String
var = "cat"
vArray2 = Filter(vArray1, var, True, vbTextCompare)
It works fine!
But how can I add "dog" to var? (so that the filtered rows contain either "cat" or "dog")
Thanks
Leon
