Variables

The following Visual Basic commands have been tested with IDEA v9 and appear to be functioning properly. I have added some examples where possible on their use.

Nothing

There are situations where an object variable does not refer to any object: It refers to nothing, and VBA has the special keyword Nothing to represent this. An object variable contains Nothing when it has been declared but not yet initialized (has not been assigned an object reference).

Finally, you can (and should) explicitly set an object reference to Nothing when you are finished using the object

Object

The Object data type can hold a reference to any object.  Using object any type of object can be referenced while you can reference specific types of objects with they type of object, such as referencing a database as a database object or a task as a task object.

Single

Name: Single

Type: Floating point

Range: -3.4 × 1038 to 3.4 × 1038 approximately

Precision: 6 digits

Static Arrays

A static array has a fixed size or number of elements. You specify the array size when you declare it, and the size cannot change during program execution.  The size will be one more than n because VBA array indexes start by default at 0.

You can use an integer variable or constant as the index.

String

String variables are used to hold text data.  A fixed-length string can be declared to contain anywhere from 1 to about 64,000 characters.  To declare a fixed-length string, use the String keyword followed by the * (asterisk) symbol and the desired size.

TypeName()

Need to add explanation.

User-Defined Types

A user-defined type (UDT) allows the programmer to define custom data elements that are specifically suited for the data at hand. A UDT can contain two or more elements, each element being a variable or array. UDTs are defined with the Type...End Type statement.

Variant

Variant is VBA’s most flexible data type as well as the default type. The Variant data type can hold almost any type of data, the exceptions being fixedlength strings and user-defined types. The downside is that Variant data requires more memory to store, and more computer power to process, than other data types.

VarType()

Need to add explanation

Pages