brkkrkmz112
New Member
- Joined
- Oct 24, 2016
- Messages
- 43
Hi,
Im trying to use autofilter to filter in columns by using the values that are stored in an array or collection as criteria . I already know it is ok with array but when ım trying that with collection I couldnt achieve my aim so far and ım just wondering it is possible or not ? Im sharing just a simple example below.
Thanks in advance.
Im trying to use autofilter to filter in columns by using the values that are stored in an array or collection as criteria . I already know it is ok with array but when ım trying that with collection I couldnt achieve my aim so far and ım just wondering it is possible or not ? Im sharing just a simple example below.
Thanks in advance.
Code:
Sub collec()
Dim fruits As New Collection
fruits.Add "orange"
fruits.Add "apple"
With ActiveSheet
.AutoFilterMode = False
.Range("G3:G6").AutoFilter field:=1, criteria:=fruits, Operator:=xlFilterValues
End With
End Sub