igold
Well-known Member
- Joined
- Jul 8, 2014
- Messages
- 3,412
- Office Version
- 365
- 2010
- Platform
- Windows
I was reading a posted question on the Forum, and in this particular post, the OP had pasted the entire code starting with the "Option Explicit" at the top. As I read the code I noticed that the OP had not Dimensioned an Array, but only Re-Dimensioned it. I thought that the code would not compile, but it did. I tested it myself and to my surprise there is no need to initially Dimension an Array, but rather if you ReDimension it, that is sufficient. As an example this code will compile.
Although I do not have any questions, if anyone wants to comment or provide some insight on this, that would be great.
VBA Code:
Option Explicit
Sub test()
ReDim arr(1 To 10, 1 To 2)
End Sub
Although I do not have any questions, if anyone wants to comment or provide some insight on this, that would be great.
Last edited: