VBA 5 Conditional Statements
VBA 5 Conditional Statements
ExcelFunctions.net
Search Site:
Custom Search
New Functions The main Excel VBA Conditional Statements are the If
... Then statement and the Select Case statement. Both
New Functions of these evaluate one or more conditions and,
depending on the result, execute specific sections of
up Tutorial code.
las
The Visual Basic If ... Then Statement
las
The If ... Then statement tests a condition and if it
evaluates to True, executes a specific section of code. If
n Excel the condition evaluates to False, a different section of
code is executed.
If Condition1 Then
ates
Code to be executed if Condition1 evaluates to True
ElseIf Condition2 Then
s
Code to be executed if Condition2 evaluates to True
.
.
utorial .
Else
vs 2007 End If
https://www.excelfunctions.net/vba-conditional-statements.html 2/5
3/9/2020 VBA Conditional Statements
https://www.excelfunctions.net/vba-conditional-statements.html 3/5
3/9/2020 VBA Conditional Statements
https://www.excelfunctions.net/vba-conditional-statements.html 4/5
3/9/2020 VBA Conditional Statements
https://www.excelfunctions.net/vba-conditional-statements.html 5/5