Although the answer to the question in title may appear at first glance to be "yes", the following VBA behavior seems to indicate it is "no". The key word to understand my question is "explicitly".
I am using VBA7 on a Windows 10 pro, x64-based PC, with Option Base 1 to start array indexes from 1
If I declare a 1D array and then try to assign a range to it, as in the following example
Dim marray(1 To 11)
marray = Range(Cells(3, 1), Cells(3, 11))
I get the error message:
The same error happens if I declare a 2D array with only one row like this
Dim marray(1 to 1, 1 To 11)
However, if I define just a variable (i.e. not an array) and then assign the range to it, as in the following example
Dim marray
marray = Range(Cells(3, 1), Cells(3, 11))
I get no error and I notice the VBA automatically creates a variant array of dimension (1 to 1, 1 to 11) as indicated in the following watch
So VBA decides that my array (variant) variable is an array of dimension (1 to 1, 1 to 11) as soon as I assign the range to it; however if I explicitly declare my variable to be an array VBA gives me an error. Can anybody explain me WHY? (It would allow me a deeper comprehension of how this strange language works)