September 2001
Beginner
528 pages
11h 59m
English
Conditional statements are used to control the execution of other VBA statements. You can specify that certain statements in your program either are executed, or are not executed, depending on conditions in the program—hence the term conditional. VBA provides two conditional statements.
The If...Then...Else statement executes a block of statements only if a specified logical condition is True. Optionally, a second block of statements are executed only if the condition is False. The syntax is as follows:
If condition Then block1 Else block2 End If
Condition is a logical expression. If condition is True, the statements in block1 are executed. If condition is False, the statements in block2 are executed. ...
Read now
Unlock full access