Category Archives: Statements

For Loops in VBA and the Continue Statement

Loops in VBA Loops are an essential part of any programming language because they help with the repeated running of any code snippet. Just like any other language, VBA offers the following loops to enable efficient programming: Do until Do while For Foreach In this

How Nested Ifs In VBA Work with Examples

All programming languages support the “if” type of conditional statement. An if block is executed during runtime only if the condition is met. i.e., the result of a condition is equal to the Boolean value “true.” Syntax If ( <conditional expression> ) ‘block of statements

How to Use the With Statement in VBA

Working On an Object As in any other language, in VBA too there may be situations where we continuously work on a specific object.  For example, we may like to apply conditional formatting to a cell based on its information by changing the font face,

The Right Way to Use the Goto Statement in VBA

The need for a branching statement in code In a procedure, the program code or the application in which the code is running may encounter unexpected issues or may not work like you expect. To be on the safe side, we can transfer the program’s control