Declaring Variable Type
You can declare a variable’s type on a Dim statement, or related declaration statements such as Public.
The following declares Sales to be a double precision floating-point number:
Dim Sales As Double
You can declare more than one variable on a Dim:
Dim SalesData As Double, Index As Integer, StartDate As Date
The following can be a trap:
Dim Col, Row, Sheet As Integer
Many users assume that this declares each variable to be Integer. This is not true. Col and Row are
Variant because they have not been given a type. To declare all three as Integer, the line should be as follows:
Dim Col As Integer, Row As Integer, Sheet As Integer