Syntax
| VarType(var)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Return a number indicating the type of value stored in var.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See Also
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example
| Sub Main
Dim X As Variant
Debug.Print VarType(X) ' 0
X = 1
Debug.Print VarType(X) ' 2
X = 100000
Debug.Print VarType(X) ' 3
X = 1.1
Debug.Print VarType(X) ' 5
X = "A"
Debug.Print VarType(X) ' 8
Set X = CreateObject("Word.Basic")
Debug.Print VarType(X) ' 9
X = Array(0,1,2)
Debug.Print VarType(X) ' 8204 (8192+12)
End Sub
|