在 Excel 中调用Test1
会为任何实数A
和0 提供 0 B
。为什么会出现这种情况?
Public Function Min(X As Double, y As Double, Optional y2 As Double, Optional y3 As Double) As Double
Min = Application.WorksheetFunction.Min(X, y, y2, y3)
End Function
Function Test1(A As Double, B As Double)
Test1 = Min(A, B)
End Function
在 Excel 中:=Test1(5,2)
.