Tag Archives: if statement

The “Else-If” Statement in VBA

We need conditional statements As a you develop code, there’s inevitably a need for the flow or logic to progress in a different direction based on the user’s inputs or on the details determined during runtime. This is where conditional statements are used. Example scenario

No Thumbnail

If/Else Then Do Nothing in Excel VBA

When we don’t want to do anything in an If-then-else statement, believe it or not, we can simply not place any code! This is the most straightforward way to ‘do nothing’ in VBA. VBA does not have a specific statement that can be used for

VBA If Statements with Multiple Conditions

Introduction One of the most common things to do in coding is to build logic that checks for the occurrence of multiple conditions. As a coder, whether novice or experienced, hopefully you agree that this is one of the most common coding tasks. In VBA,

How to Use IF OR Statements in VBA

In VBA, IF OR is the combined utilization of the IF statement and the OR keyword. Particularly, the OR keyword is used to construct the logic of the condition statement. The syntax for the combined IF OR statement is as follows: IF [condition statement 1]