This is bugging me all day.
Macro1 below works ok, picked up all 3 criteria, "data1", "data2" and "data3".
Macro2 will only pick up criteria 1, "data1", I just can't figured it out why? The reason for Macro2 is range"test" is a dynamic range, is it the right approach?
If the delete the "Operator:=xlFilterValues" at the end on Marco2, the filter will pick up the criteria one at a time and ended up with criteria3 that isn't what I wanted!
Any comments would be much appreciated.
Sub Macro1()
Dim pick(1 To 3)
pick(1) = "data1"
pick(2) = "data2"
pick(3) = "data3"
ActiveSheet.Range("$A$10:$IV$5753").AutoFilter Field:=2, Criteria1:=pick, Operator:=xlFilterValues
End Sub
Sub Macro2()
Dim pick
pick = Range("test")
ActiveSheet.Range("$A$10:$IV$5753").AutoFilter Field:=2, Criteria1:=pick, Operator:=xlFilterValues
End Sub
Bookmarks