Public Function factorial(n As Integer) As Long factorial = WorksheetFunction.Fact(n) End Function