11.3. If Statements
As in most programming languages, If statements are among the most immediately useful and versatile commands for making decisions in VBA.
In this section, you'll look at the following types of If statements:
If... Then... Else
If... Then... ElseIf... Else
11.3.1. If... Then
If... Then statements tell VBA to make the simplest of decisions: if the condition is met, execute the following statement (or statements); if the condition isn't met, skip to the line immediately following the conditional block. An If block statement begins with If and concludes with End If. However, a short If... Then statement can be written entirely on a single line, in which case the End If is omitted.
If... Then statements ...