Chapter 3Variables, Data Types, and Constants

In Chapter 2, you used the question mark to have Visual Basic return some information in the Immediate window. Unfortunately, outside the Immediate window, when you write Visual Basic procedures, you can’t use the question mark. So how do you obtain answers to your questions in VBA procedures? To find out what a particular VBA instruction (statement) has returned, you must tell Visual Basic to memorize it. This is done by using variables. This chapter introduces you to many types of variables, data types, and constants that you can and should use in your VBA procedures.

What Is a Variable?

A variable is a name used to refer to an item of data. Each time you want to remember the result of a VBA instruction, ...

Get Access 2007 Programming by Example with VBA, XML, and ASP 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.