i need to copy data from an Excel range into an array. I am using the following code, but it is showing the error "expected array."
Dim filename As String
Dim arraysize As Integer
arraysize = 50
I = 1
Do Until ThisWorkbook.Sheets("sheet1").Cells(I, 1).Value = ""
filename(arraysize) = ThisWorkbook.Sheets("sheet1").Cells(I, 1).Value
I = I + 1
Loop