2. SELECT…CASE:
Select case is also called as switch
case . Select…case structure is a
alternative of a If..Then..ElseIf
statement.
A select..case statement work with
single test expression.
If there is match then it execute a
block of statement else if no matches
found then statement associated with
optional case else statement are
execute.
4. EXAMPLE:
Private Sub Command1_Click()
b = Val(Text1.Text)
Select Case b
Case 75 To 100
MsgBox ("distinction")
Case 60 To 74
MsgBox ("Firstclass")
Case 55 To 59
MsgBox ("highersecond class")
Case 40 To 54
MsgBox ("pass")
Case 0 To 39
MsgBox ("fail")
Case Else
MsgBox "Invalid average marks"
End Select
End Sub