Another way to handle decisions in a program is to use the Select Case statement. It allows you to conditionally execute any of a series of statement groups based on the value of a test expression, which can be a single variable or a complex expression. The Select Case statement is divided into two parts: test expression to be evaluated and a series of Case statements listing the possible values.
The Select Case structure is similar to a series of If/Then/ElseIf statements. The following lines of code show the syntax of the Select Case block:
Select Case testvalue Case value1 statement group 1 Case value2 statement group 2 End Select
The first statement of the Select Case block is the Select Case statement ...