1. There are several ways of declaring the variable, the most commonly used statement is Dim statement to declare the variable. The syntax for declaring the variable using Dim is as follows:
Dim Identifier [As Data type]
2. The reserved word Dim is really short for dimension, which means ‘Size’. When you declare a variable, the amount of memory reserved depends on its data type.
3. In the Dim statement [as data type] is optional. If you omit that statement the default data type is applied to the variable.
4. Example for using Dim statement:
Dim strName as String ‘Declared the String variable
Dim intCounter as Integer ‘Declared an Integer variable
Dim curDiscount as Currency ‘Declared a currency variable
Dim vntChanging ‘Default variant data type