[VBA函数]:VBA二维数组变成三维坐标函数
Public Function ArrayConvert2to3(Array2D As Variant) As VariantDim i As Long
Dim j As Long
Dim m As Long
ReDim Newarray(0 To (UBound(Array2D) + 1) / 2 * 3 - 1) As Double
j = 0
For i = 0 To UBound(Array2D) Step 2
Newarray(j) = Array2D(i)
Newarray(j + 1) = Array2D(i + 1)
Newarray(j + 2) = 0
j = j + 3
Next i
ArrayConvert2to3 = Newarray
End Function
希望对大家有用!
沈阳杜冰 干嘛要定义变量M?
页:
[1]