Dim Statement

 

Dim variablename[(subscripts)][As Type][,name][As Type]]

 

Allocates storage for and declares the data type of variables and arrays in a module.

 

The types currently supported are integer, long, single, double and string and variant.

 

Example:

 

Sub Main

    Dim x As Long

    Dim y As Integer

    Dim z As single

    Dim a As double

    Dim s As String

    Dim v As Variant ' This is the same as Dim x or Dim x as any

          End Sub