·  VB – Syntax – Conditional Statements – Select...Case

 

- Info:

  - This tutorial shows how to use Select...Case conditional statements.

 

- Procedure:

  - Create VB Application Test.vb

 

    Test.vb

    Sub Main()

    

      a = 7

    

      Select Case a

      Case 1

        MsgBox ("Value is 1. Exit from Select.")

      Case 5

        MsgBox ("Value is 5. Exit from Select.")

      Case Else

        MsgBox ("Default value is selected if no case was true.")

      End Select

    

    End Sub