Video 5: If Statements
In this lesson, we will walkthrough how to use If statements in VBA. This will help us execute or not execute code in our script if a value matches the comparison used in the If statements.
- If statements must end with End If
- Use ElseIf if you want an additional comparison. The first comparison must return false before the subsequent ElseIf is executed
- Use Else if you want additional code to execute in case none of the If or ElseIf statements return true