Making Decisions

Visual Basic procedures can test conditions and then, depending on the results of that test, perform different operations. Visual Basic decision structures include the following statements.

To test

Use

A single condition and run a single statement or a block of statements

If...Then

A single condition and choose between two statement blocks

If...Then...Else

More than one condition and run one of several statement blocks

If...Then...ElseIf

A single condition and run one of several statement blocks

Select Case