Hello, MrExcel!
One simple questions about VBA arrays.
Is there a way I can initialize all the elements inside an array at once, specifically multidimensional array?
For example, in C/C++
What about in VBA??
All I know for initializing a VBA array is by setting value for every single element separately.
I.e:
Is there a short way of doing this?
Otherwise, I will need 30 lines;;; which is... bad;;
Thank you in advance!
kpark
One simple questions about VBA arrays.
Is there a way I can initialize all the elements inside an array at once, specifically multidimensional array?
For example, in C/C++
Code:
int c[2][5] =
{
{1,2,3,4,5},
{2,3,4,5,6},
};
What about in VBA??
Code:
Dim arr(1 To 10, 1 To 3) As Integer
All I know for initializing a VBA array is by setting value for every single element separately.
I.e:
Code:
arr(1,1) = 256
arr(1,2) = 244
arr(1,3) = 8
Is there a short way of doing this?
Otherwise, I will need 30 lines;;; which is... bad;;
Thank you in advance!
kpark