REM "获取数组长度"
Public Function ArrayLength(ByVal ary) As Integer
ArrayLength = UBound(ary) - LBound(ary) + 1
End Function
REM "调用示例"
Sub SplitSample()
'声明
Dim temp() As String
Dim EgStr As String
'执行过程
EgStr = "str1 str2 str3"
temp = Split(EgStr, " ")
MsgBox(ArrayLength(temp))
End Sub
【SolidWorks宏】VBA 获取数组的长度
最新推荐文章于 2022-05-21 09:47:54 发布