Function Proc(m As Integer) Dim t As Double If IsNumeric(m) Then For j = 1 To m t = t + Application.WorksheetFunction.Fact(j) Next Proc = t Else Proc = -1 End IfEnd Function
这是实现计算过程的函数,在需要的地方调用即可。