• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

10.4. Variables and Data Types

A variable can be thought of as a memory location that can hold values of a specific type. The value in a variable may change during the life of the program—hence the name variable.

In VBA, each variable has a specific data type , which indicates which type of data it may hold. For instance, a variable that holds text strings has a String data type and is called a string variable. A variable that holds integers (whole numbers) has an Integer data type and is called an integer variable. For reference, Table 10.1 shows the complete set of VBA data types, along with the amount of memory that they consume and their range of values. We will discuss a few of the more commonly used data types in a moment.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint