Is is possible to use a simple variable name to refer to a location in a VBA array?
I thought the location might be an object so I tried doing it kind of like this:
Sub ArrayRef()
Dim X As Integer
Dim ArrayWithQuiteALongName(1 To 3) As Integer
Dim A As Object
For X = 1 To 3
Set A = ArrayWithQuiteALongName(X)
A = X * 10
A = A * 10
Next X
Debug.Print ArrayWithQuiteALongName(1) = 100
Debug.Print ArrayWithQuiteALongName(2) = 200
Debug.Print ArrayWithQuiteALongName(3) = 300
End Sub
In the example I would expect a Debug.Print output of
TRUE
TRUE
TRUE
But this doesn't work and I can't seem to find any information on if it's possible