6.1.2.7.1.13 VarType

Function Declaration

 Function VarType(VarName As Variant) As VbVarType 

Parameter

Description

VarName

Any data value.

 

Runtime Semantics.

§ Returns an Integer indicating the subtype of a variable.

§ The required VarName argument is a Variant containing any variable except a variable of a user-defined type.

§ Returns a value from the following table based on VarName’s value type:

VarName’s value type

Value

Any Array type

8192 + VarType of element’s type

Boolean

11

Byte

17

Currency

6

Date

7

Decimal

14

Double

5

Empty

0

Error or Missing

10

Integer

2

Long

3

LongLong (defined only on implementations that support a LongLong value type)

20

Null

1

Object reference

9

Single

4

String

8

Any UDT

36 when the declared type is Variant.

 

0 when the declared type is a UDT.

Variant (as an element type of an array)

12

An implementation-defined value that can be stored in a Variant but that has no value in VBA

13