16  Programming in VBA

16.1 Structure of a VBA program

A program is a list of instructions to the computer. The point is to make the computer perform a task. To avoid chaos, a program needs to have a certain structure. The computer cannot execute the instructions in random order, as this will lead to an unpredictable result. In VBA the list of instructions is put within the context of a procedure, or subroutine as it is called in VBA. A procedure consists of a list of instructions. Each instruction is called a statement, and is usually written on a new line. The computer will execute the statements in sequential order, starting at the top. Later in this book we will see that the order of execution can be changed by the use of control structures. ...

Get Financial Modelling and Asset Valuation with Excel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.