Dim i As Single
Dim j As String
Do
j = InputBox("请输入一个正整数:", "标题")
j = Trim(j)
If j = "" Then
MsgBox "空值或取消"
ElseIf Not IsNumeric(j) Then
MsgBox "非数字"
Else
i = CSng(j)
If i <> Int(i) Then
MsgBox "有小数"
ElseIf i < 0 Then
MsgBox "非正数"
Else
Exit Do
End If
End If
Loop