Skip to main content

Select Case Statements

The other way to test the data inside a variable is by using a Select case Statements. In visual basic, the Select case statements are just like If statement but with a little difference. For me, the Select Case statement is better and more efficient. This is because every If statement must be executed one at a time, but the Select Case statement is only executed once and then it moves on to the next stage in the code. Sample Syntax

Select [ Case ] testexpression
    [ Case expressionlist
        [ statements ] ]
    [ Case Else
        [ elsestatements ] ]
End Select
This time

Add new comment

File attachments