I’ve run into a problem, I cannot seem to figure out, using basic array functionalities. I’m using the following (standard) code:
Sub CC() Dim arrB As Variant arrB = Sheet2.Range("B3:B100").Value2 Debug.Print LBound(arrB) & " " & UBound(arrB) Debug.Print arrB(LBound(arrB)) End Sub
Debug.Print statement returns “1 98” as expected. But when I try to access any values inside the array
arrB with my second
Debug.Print I’m getting a run-time error 9 (Index out of range). Any ideas on what I’m missing here?
For future tasks with arrays – that was quick because I had many many struggles before, the easiest way to deal with arrays is to Add Watch on them.
By that You would see how it looks and how many dimensions it has 🙂
I’m glad that I could help 🙂