Is there a simpler way to make an array list other than Adding in all the values line by line?
Code:
Option Explicit
Dim ARRV2 as ArrayList
Set ArrV2 = New ArrayList
ArrV2.Add "zz" '0
ArrV2.Add "A" '1
ArrV2.Add "B" '2
ArrV2.Add "C" '3
ArrV2.Add "D" '4
ArrV2.Add "E" '5
ArrV2.Add "F" '6
ArrV2.Add "G" '7
ArrV2.Add "H" '8
ArrV2.Add "J" '9
ArrV2.Add "K" '10
ArrV2.Add "L" '11
ArrV2.Add "M" '12
ArrV2.Add "N" '13
ArrV2.Add "P" '14
ArrV2.Add "HHB" '15
ArrV2.Add "HHC" '16
ArrV2.Add "HHT" '17
ArrV2.Add "HHBN" '18
ArrV2.Add "COY" '19
ArrV2.Add "MAIN" '20
ArrV2.Add "TAC" '21
ArrV2.Add "HSMCC" '22
Something like this?
ArrV2 = Array("A", "B", "C",............... "HSMCC", "HHB", "HHC")
With
Set ArrV2 = New ArrayList
ArrV2 = Array("A", "B", "C",............... "HSMCC", "HHB", "HHC")
I get Runtime Error 5, without Set ArrV2 = New ArrayList Error 91 - with object variable or with block variable not set.
The ArrV2.Add " it works.
I can use the following way as a list filter:
Worksheets(1).Range("H1").AutoFilter Field:=8, Criteria1:=Array("FE", "MTOE", "PH", "PARA", "PLAT"), Operator:=xlFilterValues