Reading array from Spreadsheet Data VBA

I'm sending a range into an array in VBA. But, when I try to reference parts of the array, I get a "Subscript Out of Range" error. I know that the range is successfully being transferred, because I can then send the array back into a different range.

Dim LastClmn() As Variant   'The last column of brake data
Set RangeSet = ws.Range("RJ2:RJ" & ii)
LastClmn() = RangeSet
Msgbox LastClmn(4)

Referencing a piece of the array is what causes the error


Try LastClmn(4,1)

I found it by using the Locals Window under View in the menu bar.

Need Your Help

Need a batch file to move files

windows batch-file

I am looking for a small, free program I can use to move files from one folder to another. I've done a little research and think Batch files might be my best bet. Unfortunately, I've never used Batch