Case Select

Sub Macro1()
    Dim intInput
    intInput = -1
    While intInput < 0
    intInput = InputBox("Enter a positive number")
    Select Case intInput
        Case 1:
        MsgBox ("Thank you.")
        Case 2:
        MsgBox ("That's fine.")
        Case 3:
        MsgBox ("Your input is getting pretty big now...")
        Case 4 To 10:
        MsgBox ("You are approaching the maximum!")
        Case Is > intMax:
        MsgBox ("Too big, sorry.")
        Case Else:
        MsgBox ("Please try again.")
    End Select
End Sub
Total Page Visits: 39 - Today Page Visits: 2

Leave a Reply