ABSTRACT

A variable is a named storage location in a computer's memory. Variables allow us to store values and then come back to these values at a later time. This chapter introduces how to declare variables and some common data types. After studying the chapter, readers will be able to know the common data types supported by Visual Basic for Applications. The readers will be able to know how to declare and use variables and constants; and use arrays; know how to manipulate dates and strings and understand the concept of scopes. The chapter introduces how to declare arrays, which can contain multiple values. In particular, it introduces one-dimensional, multidimensional, and dynamic arrays. An array is a group of variables that share a common name. The chapter refers to a specific variable in an array by using the array name and an index number in parentheses. It presents examples for how to declare one-dimensional arrays, multidimensional, and dynamic arrays.