Understanding Variables and Constants

VBA provides many levels of data interpretation. Some data interpretations help you make your program reliable, others make it run faster, still others provide accuracy, and a few make the data easier to interpret. One of the two big distinctions is between variables and constants. You can modify a variable anytime the program can actually access it. A constant, however, retains the same value all the time. You use variables as storage containers for data that changes, and you use constants for data that doesn't change. Variables are more flexible than constants are, but constants make your program run faster, so each type of storage has its place.

Was this article helpful?

0 0

Post a comment