很简单的VB问题

来源:百度知道 编辑:UC知道 时间:2024/05/02 07:58:55
Private Sub Command1_Click()
Dim i As Integer
i = InputBox("")
Select Case i
Case Is >= 90
Print "good"
Case Is >= 70
Print "cool"
Case Is >= 60
Print "great"
Case Is >= 0
Print "bad"
Case Else
Print "error"
End Select
End Sub
我想让这个代码不算大于100的数,怎么修改啊?为什么我用Case Is >= 90<=100没有用啊?
谢谢,分不多~
〇星瓢虫 的答案不对~

Private Sub Command1_Click()
Dim i As Integer
i = InputBox("")

Do While i <= 100
Select Case i
Case Is >= 90
Print "good"
Exit Sub
Case Is >= 70
Print "cool"
Exit Sub
Case Is >= 60
Print "great"
Exit Sub
Case Is >= 0
Print "bad"
Exit Sub
Case Else
Print "error"
Exit Sub
End Select
Loop
End Sub

if i>=100 then exit sub

或者把 is>= 这些全部改掉 ,比如改成 90 to 99 ,70 to 89 ,等等

Case is > 100
Print "error"

Private Sub Command1_Click()
Dim i As Integer
i = InputBox("")
Select Case i
Case Is > 100'加上大于100的这种情况
Print "error"'大于100就打印error
Case Is >= 90
Print "good"
Case Is &g