What is the syntax for Select Case?

Select Case <value>
    Case <value1>
        ‘your code here
    Case <value2>
        ‘your code here

    Case Else
        ‘your code here
End Select
‘example
Select Case userGradeInput ‘userGradeInput is an integer variable
    Case 100
        MsgBox “You got a perfect grade!”
    Case Else
        MsgBox “You did not get a perfect grade.”
End Select

 

Advertisements