Private Sub CommandButton1_Click()
If Not IsNumeric(UserForm1.TextBox1.Text) Or Not IsNumeric(UserForm1.TextBox2.Text) Then
MsgBox "不是合法字符"
Exit Sub
End If
If UserForm1.TextBox1.Text * 1 > UserForm1.TextBox2.Text * 1 Then MsgBox "第一个数值较大"
If UserForm1.TextBox1.Text * 1 < UserForm1.TextBox2.Text * 1 Then MsgBox "第二个数值较大"
If UserForm1.TextBox1.Text * 1 = UserForm1.TextBox2.Text * 1 Then MsgBox "数值相等"
End Sub