The following code gives me error 9 “subscript out of range”. I meant to declare a dynamic array so that the dimension changes as I add elements to it. Do I have to create a “spot” on the array before I store something in it like in JS?
Sub test_array()
Dim test() As Integer
Dim i As Integer
For i = 0 To 3
test(i) = 3 + i
Next i
End Sub
in your for loop use a Redim on the array like here: