我知道了
谢谢楼上各位的指教!

生命中,不断有人离开和进入。于是,看见的,看不见了;记住的,遗忘了。
法一:
If Text1.Text = "" Then
   
MsgBox "输入框为空!"
   
Exit Sub
ElseIf Not IsNumeric(Trim(Text1)) 
Then
   
MsgBox "输入的数值有误!"
   
Exit Sub
End If
这个语句可以判断是不是空的,是不是数值
法二:
Dim shu As Double
If Text1.Text = "" Then
   
MsgBox "输入框为空!"
  
Exit Sub
ElseIf Not IsNumeric(Trim(Text1)) 
Then
   
MsgBox "输入的数值有误!"
   
Exit Sub
End If
shu = Val(Text1.Text)
Do
shu = shu - 1
Loop Until shu <= 0
If shu <> 0 Then
   
MsgBox "输入的值不是整型!"
   
Exit Sub
End If
让输入的数值不停的减1,直到小于0,或等于0,
如果是整数最后肯定等于0,如果是小数最后肯定小于0,
所以这时可以通过判断最后的差是否是0,来判断输入的数值是不是整数!
法三:
For i = 1 To 3
        a(i) = InputBox("请输入第" & CStr(i) & "个数")
        If a(i)>fix(a(i)) then 
           MsgBox("请输入一个整数")
           i=i-1
        End If
Next
法四:
tpstr = Val(InputBox("请输入第1个数"))
   small = CInt(tpstr)
   If tpstr <> small Then MsgBox "请输入整数"
法五:
If Val(Text1.Text) <> Int(Text1.Text) Then MsgBox "Error!"
法六:
If Not IsNumeric(TxtInput.Text) or InStr(TxtInput.Text,".")<> 0   Then
    msgbox"必须输入正数!"
    TxtInput.SetFocus
End If
