Essential VBA Language Elements
IN THIS CHAPTER
Knowing when, why, and how to use comments in your code
Using variables and constants
Telling VBA what type of data you’re using
Getting familiar with arrays
Knowing why you may need to use labels in your procedures
Because VBA is a real, live programming language, it uses many elements common to all programming languages. In this chapter, you’re introduced to several of these elements: comments, variables, constants, data types, arrays, and a few other goodies. If you’ve programmed with other languages, some of this material will be familiar. If you’re a programming newbie, it’s time to roll up your sleeves and get busy.
Using Comments in Your VBA Code
A comment is the simplest type of VBA statement. Because VBA ignores these statements, they can consist of anything you want. You can insert a comment to remind yourself why you did something or to clarify some particularly elegant code you wrote.