malleshg24
11-07-2019, 10:07 PM
Hi Team,
I am trying to understand Array here, I can filter data with this array with the below Code.
Dim Myarray As Variant
Myarray = Array("A", "B", "C", "D", "E")
Sheet1.Range("A1").CurrentRegion.AutoFilter 1, Criteria1:=Myarray, Operator:=xlFilterValues
I cant filter data with this below code. if I take array from range
Dim myarray2 As Variant
myarray2 = Sheet2.Range("a1:a5").Value 'It contains (A,B,C,D,E)
Sheet1.Range("A1").CurrentRegion.AutoFilter 1, Criteria1:=myarray2, Operator:=xlFilterValues
Are below array are different? even though same values.
Myarray = Array("A", "B", "C", "D", "E")
myarray2 = Sheet2.Range("a1:a5").Value
please suggest a solution for converting multidimension into single and vice - versa.
Thanks in advance
mg
I am trying to understand Array here, I can filter data with this array with the below Code.
Dim Myarray As Variant
Myarray = Array("A", "B", "C", "D", "E")
Sheet1.Range("A1").CurrentRegion.AutoFilter 1, Criteria1:=Myarray, Operator:=xlFilterValues
I cant filter data with this below code. if I take array from range
Dim myarray2 As Variant
myarray2 = Sheet2.Range("a1:a5").Value 'It contains (A,B,C,D,E)
Sheet1.Range("A1").CurrentRegion.AutoFilter 1, Criteria1:=myarray2, Operator:=xlFilterValues
Are below array are different? even though same values.
Myarray = Array("A", "B", "C", "D", "E")
myarray2 = Sheet2.Range("a1:a5").Value
please suggest a solution for converting multidimension into single and vice - versa.
Thanks in advance
mg