I have a data sheet like this
ID Name
-------------------
B23 Max
D27 Nads
W34 sads
A65 Robin
C37 Harvard
C65 Nivkai
V87 adsdasd
Q78 sadsad
I need to put all IDs into an "One dimetional Array" as string.So I tried this,
Dim RowCount As Integer
RowNumber = wb1.Sheets(1).UsedRange.Rows.Count
Dim idArray() As String
For j = 1 To RowNumber
ID = wb1.Sheets(1).Cells(j, 1).Value
ReDim idArray(j)
idArray(j) = CStr(ID)
Next j
My main goal is to apply a filter on a different sheet using this idArray in this way
wb2.Sheets(1).Range(Selection, Selection.End(xlDown)).AutoFilter Field:=1, Criteria1:=idArray(), Operator:=xlFilterValues
But later when I'm trying to print the entire array using below code, its printing nothing.And seems idArray() is empty.
For n = 1 To UBound(idArray)
Debug.Print QidArray(n)
Next n
Can anyone please tell me what I'm doing wrong.
Thanks,