CHAPTER 3
VBA Programming Fundamentals
VBA Language Elements: An Overview
If you've used other programming languages, much of the information in this chapter may sound familiar. However, VBA has a few unique wrinkles, so even experienced programmers may find some new information.
This chapter explores the VBA language elements, which are the keywords and control structures that you use to write VBA routines.
To get the ball rolling, take a look at the following VBA Sub
procedure. This simple procedure, which is stored in a VBA module, calculates the sum of the first 100 positive integers. When the code finishes executing, the procedure displays a message with the result.
Sub VBA_Demo()
' This is a simple VBA Example
Dim Total As Long, i...