| 'factorial
function
Public Function Factorial(ByVal Factor
As Byte) As Variant
On Error GoTo ErrorHandler
If Factor = 0 Then
Factorial = 1
Else
Factorial = Factor * Factorial(Factor
- 1)
End If
Exit Function
ErrorHandler:
MsgBox Err.Description
End Function
Private Sub Form_Load()
MsgBox Factorial(3)
End Sub
|