Value Variant type
0 Empty (unitialized)
1 Null (no valid data)
2 Integer
3 Long Integer
4 Single
5 Double
6 Currency
7 Date
8 String
9 Object
10 Error value
11 Boolean
12 Variant (only used with arrays of variants)
13 Data access object
14 Decimal value
17 Byte
36 User Defined Type
8192 Array
Sub VariantExample()
Dim varAnyThing As Variant
varAnyThing = 12.345
Debug.Print VarType(varAnyThing)
varAnyThing = 12.345
varAnyThing = varAnyThing & " is a number"
Debug.Print VarType(varAnyThing)
varAnyThing = 12.345
varAnyThing = varAnyThing + "10"
Debug.Print VarType(varAnyThing)
varAnyThing = 12345
Debug.Print VarType(varAnyThing)
varAnyThing = 123456
Debug.Print VarType(varAnyThing)
End Sub
|