📜  vba 数组维度 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:56.408000             🧑  作者: Mango

代码示例1
Public Function ArrayDimensions(ByRef Arr As Variant) As Integer
    Dim indDim As Integer
    Dim result As Integer
    On Error Resume Next
    Do
        indDim = indDim + 1
        result = UBound(Arr, indDim)
    Loop Until err.Number <> 0
    ArrayDimensions = indDim - 1
End Function