Private Sub CommandButton1_Click()
Dim a, b1, b2, i, tmp
Set b1 = Me.TextBox1
Set b2 = Me.TextBox2
a = b1.Text
If Len(a) = 0 Then tmp = "#Len = 0": GoTo 1000
If Not IsNumeric(a) Then tmp = "#Not Is Number": GoTo 1000
a = a * 1
If Int(a) <> a Then tmp = "#not Integer": GoTo 1000
If a < 1 Or a > 9 Then tmp = "#" & IIf(a < 1, "<1", ">9"): GoTo 1000
tmp = a
For i = a - 1 To 2 Step -1
tmp = tmp * i
Next
1000:
b2.Text = tmp
End Sub
Private Sub CommandButton1_Click()
Dim a, b1, b2, i, tmp
Set b1 = Me.TextBox1
Set b2 = Me.TextBox2
a = b1.Text
If Len(a) = 0 Then tmp = "#Len = 0": GoTo 1000
If Not IsNumeric(a) Then tmp = "#Not Is Number": GoTo 1000
a = a * 1
If Int(a) <> a Then tmp = "#not Integer": GoTo 1000
If a < 1 Or a > 9 Then tmp = "#" & IIf(a < 1, "<1", ">9"): GoTo 1000
tmp = a
For i = a - 1 To 2 Step -1
tmp = tmp * i
Next
1000:
b2.Text = tmp
End Sub