Rules for Variable Declaration
When you are declaring variables or named constants, some rules must be observed. Any violation of the rules will result in a syntax error. These rules include:
- A variable or constant name can contain any combination of letters, numbers and underscore; must begin with a letter or underscore; and must have at least one letter or digit if it begins with an underscore.
- If the variable is a reserved keyword, it must be enclosed with a pair of brackets, such as [Case]. (Case is a reserved keyword. You will learn about it in Chapter 5, “Decision.”)
- A variable must not contain any embedded period, such as Your.Name, or embedded special characters used for data type declaration, such as The%Completed.
Figure 4-1
Setting Option Explicit On

Last change: February 13 2016 18:47:34.