I am reading an excel sheet and I would like to store the value into an array, but It is not working. Any help would be most appreciated.
With objReadWS
lastRow2 = .Range("G" & .Rows.Count).End(xlUp).Row
lastCol2 = .Cells(2, .Columns.Count).End(xlToLeft).Column
Redim Array100(i)
For each x in .Range(.Cells(lastRow2, 18), .Cells(lastRow2, lastCol2))
Array100(i) = x.Value
i = i + 1
Next
End With
For i = LBound(Array100) To UBound(Array100)
msgbox Array100(i)
next
With objReadWS
lastRow2 = .Range("G" & .Rows.Count).End(xlUp).Row
lastCol2 = .Cells(2, .Columns.Count).End(xlToLeft).Column
Redim Array100(i)
For each x in .Range(.Cells(lastRow2, 18), .Cells(lastRow2, lastCol2))
Array100(i) = x.Value
i = i + 1
Next
End With
For i = LBound(Array100) To UBound(Array100)
msgbox Array100(i)
next