dubing 发表于 2002-4-23 01:29:51

[VBA函数]:VBA二维数组变成三维坐标函数

Public Function ArrayConvert2to3(Array2D As Variant) As Variant
    Dim 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

希望对大家有用!
                                 沈阳杜冰

lee918 发表于 2014-12-29 14:16:37

干嘛要定义变量M?
页: [1]
查看完整版本: [VBA函数]:VBA二维数组变成三维坐标函数