vba自定义函数,为什么运行不了?
PublicFunctionping(ParamArrayn())Dimx,arr()ReDimarr(0ToUBound(n))Forx=0ToUBound(n)IfI...
Public Function ping(ParamArray n())
Dim x, arr()
ReDim arr(0 To UBound(n))
For x = 0 To UBound(n)
If IsNumeric(n(x)) = True Then
arr(x) = n(x)
Else
arr(x) = Left(n(x), Len(n(x) - 1)) / 2
End If
Next x
ping = Application.Average(arr())
End Function 展开
Dim x, arr()
ReDim arr(0 To UBound(n))
For x = 0 To UBound(n)
If IsNumeric(n(x)) = True Then
arr(x) = n(x)
Else
arr(x) = Left(n(x), Len(n(x) - 1)) / 2
End If
Next x
ping = Application.Average(arr())
End Function 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询