If...Then...Else Statement

If conditional Then statement

Allows conditional statements to be executed in the code.

Syntax 1

  1. If condition Then thenpart [Else elsepart]

Syntax 2

  1. If condition Then

    1. [statement(s)]

    ElseIf condition Then

    1. [statement(s)]

    Else

    1. [statements(s)].

    End If

Related Topics:

Select Case

More:

Example - If...Then...Else Statement