Hi,
I have the following vba code, which populates an array with the contents of the first 5 rows of column A.
Sub populate_array()
Dim parameters_2DArray as Variant
parameter_2DArray = Worksheets("Sheet1").Range("A1:A5").Value
[rest of code]
End Sub
I'm assuming the parameter_2DArray comprises 5 rows and 1 column. I want to increase the number of columns later in code by one, and have tried doing so using the following line;
ReDim Preserve parameter_2DArray(ubound(parameter_2DArray,1), ubound(parameter_2DArray,2)+1)
...but to no avail. I have also tried the following, but again, to no avail;
ReDim Preserve pipework_2DArray(5, 2)
Is what I'm trying to do possible this way? Any help etc. would be much appreciated.
Kind regards,
2016LM
I have the following vba code, which populates an array with the contents of the first 5 rows of column A.
Sub populate_array()
Dim parameters_2DArray as Variant
parameter_2DArray = Worksheets("Sheet1").Range("A1:A5").Value
[rest of code]
End Sub
I'm assuming the parameter_2DArray comprises 5 rows and 1 column. I want to increase the number of columns later in code by one, and have tried doing so using the following line;
ReDim Preserve parameter_2DArray(ubound(parameter_2DArray,1), ubound(parameter_2DArray,2)+1)
...but to no avail. I have also tried the following, but again, to no avail;
ReDim Preserve pipework_2DArray(5, 2)
Is what I'm trying to do possible this way? Any help etc. would be much appreciated.
Kind regards,
2016LM