Visual Basic Data Types

See AlsoDP6ZI7

The following table shows the fundamental data types3GYXY7 supported by Visual Basic, and the type-declaration suffix4TVC9NP, storage size, and range of each data type.

Data type

Suffix

Storage size

Range

 

IntegerDOKXHY

%

bytes

-32,768 to 32,767.

Long103F6YL
(long integer)

&

bytes

-2,147,483,648 to 2,147,483,647.

Single6H5W9RZ
(single-precision floating-point)

!

bytes

-3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.

Double25ZA7GP
(double-precision floating-point)

#

bytes

-1.79769313486232E308 to
-4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.

Currency14B7V4
(scaled integer)

@

bytes

-922,337,203,685,477.5808 to 922,337,203,685,477.5807.

String7WSH0XQ

$

byte per character

to approximately 65,500 bytes. (Some storage overhead is required.)

Variant2ZCGYKB

None

As appropriate

Any numeric value up to the range of a Double or any character text.

User-defined81K105K (using TypeGUBAD0)

None

Number required by elements

The range of each element is the same as the range of its fundamental data type, listed above.

 


See Also

Currency Data Type14B7V4

Double Data Type25ZA7GP

Integer Data TypeDOKXHY

Long Data Type103F6YL

Single Data Type6H5W9RZ

String Data Type7WSH0XQ

Type StatementGUBAD0

Variant Data Type2ZCGYKB