'得到一个数组的指定维的长度,如有错,则返回0
Public Function ArrayLength(paszIn As Variant, Optional pnIndex As Integer = 1) As Long
Dim lLow As Long, lHigh As Long
On Error GoTo here
lLow = LBound(paszIn, pnIndex)
lHigh = UBound(paszIn, pnIndex)
ArrayLength = lHigh - lLow + 1
Exit Function
here:
ArrayLength = 0
End Function
Public Function ArrayLength(paszIn As Variant, Optional pnIndex As Integer = 1) As Long
Dim lLow As Long, lHigh As Long
On Error GoTo here
lLow = LBound(paszIn, pnIndex)
lHigh = UBound(paszIn, pnIndex)
ArrayLength = lHigh - lLow + 1
Exit Function
here:
ArrayLength = 0
End Function
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货