
VBA Statements: The Building Blocks of VBA Programs
VBA programs are nothing but a sequence of VBA statements. They are the cornerstone of VBA programs. Here, we explore these vital elements of VBA coding.
Tags content that has to do with executable VBA statements that transfer program execution or control from one code-line to another and in or out of procedures.

VBA programs are nothing but a sequence of VBA statements. They are the cornerstone of VBA programs. Here, we explore these vital elements of VBA coding.
![The On Error and Resume statements’ syntax. Square brackets, [ ], vertical bars, |, and curly braces, {}, indicate optional items, mutually exclusive items, and mere item groupings, respectively.](https://masterofficevba.com/wp-content/uploads/2021/03/On_Error_and_Resume_Statements_Syntaxnew.png)
Here, you’ll explore the On Error Statement which transfers control to error-handling subroutines when a runtime error occurs.
![The On -GoSub statement’s syntax. Square brackets, [ ], vertical bars, |, and curly braces, {}, indicate optional items, mutually exclusive items, and mere item groupings, respectively.](https://masterofficevba.com/wp-content/uploads/2021/03/On_GoSub_Statement_Syntaxnew.png)
Here, you’ll explore the On – GoSub statement which conditionally transfers control between a code-line and a subroutine in the same scope.
![The GoSub – Return statement’s syntax. Square brackets, [ ], vertical bars, |, and curly braces, {}, indicate optional items, mutually exclusive items, and mere item groupings, respectively.](https://masterofficevba.com/wp-content/uploads/2021/03/GoSub_Return_Statement_Syntaxnew.png)
Here, you’ll explore the GoSub – Return statement which unconditionally transfers control between a code-line and a subroutine in the same scope.

Here, you’ll explore the On – GoTo statement which conditionally transfers control to any labelled statement within the same scope (i.e., procedure).

Here, you’ll explore the GoTo statement which unconditionally transfers control to any labelled statement in the same scope (i.e., procedure).

Here, you’ll explore the Call statement which transfers control between procedures and DLLs. It is a VBA jump statement for non-sequential code execution.

Here, you’ll explore the Exit statement which instantly leaves a block. It is one of several VBA jump statements that enables non-sequential code execution.