Search notes:

VBA: variables

A variable has a datatype.
The address in memory where the value of a variable is stored is returned with the function varPtr(var).

Lifetime of variables

The time between the creation and destruction of a variable is the variable's lifetime (aka extent).
There are five lifetimes for variables

Declaring variables

dim statement

The dim statement declares a variable that is

global statement

A variable can be declared global at module level in which case the variable is accessible from other modules as well.

See also

In order to make sure that variables are declared (dim statement), option expclicit can be used.
Null and nothing etc.

Index