Variables: More Powerful Than Names

To store a value as a variable in Microsoft Excel version 4.0, you'd typically store the value in a name. In Visual Basic, you'd assign the value to a variable instead.

Variables are much more flexible than names. You can make variables available to all procedures, to only the procedures in a given module, or to only a single procedure. You can control the type of data that can be stored in a variable and even create variables that store a combination of your choice of data types.

In Visual Basic, you can also define constants to hold static (constant) values that you can refer to repeatedly. For more information about variables and constants in Visual Basic, see Chapter 2, "Variables, Constants, and Data Types."