richarddawson
Board Regular
- Joined
- Oct 18, 2014
- Messages
- 87
I have a single sheet workbook; with A1 = "a"; A2 = "b"; down to A6 = "f".
The entire programme is below
The bounds print correctly ; 1 6
But I get an error '9' "Subscript out of range" on the next line ("Debug.Print Arr(3)")
I have used arrays many times - but this defeats me - can anyone help, please?
Dim Arr() As Variant
Sub getArray()
Arr = Range("A1:A6")
Debug.Print LBound(Arr) & " " & UBound(Arr)
Debug.Print Arr(3)
End Sub
The entire programme is below
The bounds print correctly ; 1 6
But I get an error '9' "Subscript out of range" on the next line ("Debug.Print Arr(3)")
I have used arrays many times - but this defeats me - can anyone help, please?
Dim Arr() As Variant
Sub getArray()
Arr = Range("A1:A6")
Debug.Print LBound(Arr) & " " & UBound(Arr)
Debug.Print Arr(3)
End Sub