Select Case Statement

Syntax
Select Case expr
[Case caseexpr[, ...] [ : instruction ]
    statements]...
[Case Else [ : instruction ]
    statements]
End Select
Group
Flow Control
Description
Select the appropriate case by comparing the expr with each of the caseexprs. Select the Case Else part if no caseexpr matches. (If the Case Else is omitted then skip the entire Select...End Select block.) Only the statements from the matched Case up to the next Case are executed.
caseexpr Description
expr Execute if equal.
Is < expr Execute if less than.
Is <= expr Execute if less than or equal to.
Is > expr Execute if greater than.
Is >= expr Execute if greater than or equal to.
Is <> expr Execute if not equal to.
expr1 To expr2 Execute if greater than or equal to expr1 and less than or equal to expr2.
See Also
If, Choose( ), If( ), IIf( )

Sub Main
    S = InputBox("Enter hello, goodbye, dinner or sleep:")
    Select Case UCases
    Case "HELLO", "HI"
        Debug.Print "come in"
    Case "GOODBYE", "BYE"
        Debug.Print "see you later"
    Case "DINNER"
        Debug.Print "Please come in."
        Debug.Print "Dinner will be ready soon."
    Case "SLEEP"
        Debug.Print "Sorry."
        Debug.Print "We are full for the night"
    Case Else
        Debug.Print "What?"
    End Select
End Sub