Often, you'll find that your macro contains constant values that reappear again and again. Or you may find that the macro depends on certain numbers that are difficult to remember — numbers that, in and of themselves, have no obvious meaning.
In these cases, you can greatly improve the readability of your macro — and make it easier to maintain — by using constants. A constant is a meaningful name that takes the place of a number or string that doesn't change. Although a constant somewhat resembles a variable, you cannot modify a constant or assign a new value to it as you can do with a variable. There are two sources for constants:
Intrinsic constant names have a mixed-case format, with a two-character prefix indicating the object library that defines the constant. Constants from the Microsoft Excel object library are prefaced with "xl" — for instance, xlAbsolute. Constants from the data access object library are prefaced with "db" — for instance, dbRelationUnique.
Tip
Use constants when you need to use the same value several times in your macro, or when you want to make your macro more readable by assigning a meaningful name to a value that doesn't change.