PrivateSubCommandButton1_Click()
Dima,b1,b2,i,tmp
Setb1=Me.TextBox1
Setb2=Me.TextBox2
a=b1.Text
IfLen(a)=0Thentmp="#Len=0":GoTo1000
IfNotIsNumeric(a)Thentmp="#NotIsNumber":GoTo1000
a=a*1
IfInt(a)<>aThentmp="#notInteger":GoTo1000
Ifa<1Ora>9Thentmp="#"&IIf(a<1,"<1",">9"):GoTo1000
tmp=a
Fori=a-1To2Step-1
tmp=tmp*i
Next
1000:
b2.Text=tmp
EndSub