02-10-2014, 03:07 PM
In this case you can use that single dimensional array to create double dimensional array.
Get the count of that array and loop through the same array and assign same values to two dimensional array:
After running this code remove empty element from the array. This code will traverse your single dimensional array and insert each value from the single dimensional array to two dimensional array.
Get the count of that array and loop through the same array and assign same values to two dimensional array:
Code:
Dim TwoDimArray()
singleDimArray = Array("a", "b", "c", "d", "e", "f", "g")
ReDim TwoDimArray(UBound(singleDimArray), 1)
For i = 0 To UBound(singleDimArray) Step 2
For j = 0 To 1 Step 1
If j = 0 Then
TwoDimArray(i, j) = singleDimArray(i)
Else If i<6 Then
TwoDimArray(i, j) = singleDimArray(i+1)
End IF
End If
Next
Next
After running this code remove empty element from the array. This code will traverse your single dimensional array and insert each value from the single dimensional array to two dimensional array.