Tuesday, August 2, 2016

VarType Function

Chức năng
Trả về một số nguyên đại điện cho loại của một biến.

Cú pháp
VarType ( Varname )
Bảng giá trị trả về:

Constant Value Description
vbEmpty 0 Empty (uninitialized)
vbNull 1 Null (no valid data)
vbInteger 2 Integer
vbLong 3 Long integer
vbSingle 4 Single-precision floating-point number
vbDouble 5 Double-precision floating-point number
vbCurrency 6 Currency value
vbDate 7 Date value
vbString 8 String
vbObject 9 Object
vbError 10 Error value
vbBoolean 11 Boolean value
vbVariant 12 Variant (used only with arrays of variants)
vbDataObject 13 A data access object
vbDecimal 14 Decimal value
vbByte 17 Byte value
vbLongLong 20 LongLong integer (Valid on 64-bit platforms only.)
vbUserDefinedType 36 Variants that contain user-defined types
vbArray 8192 Array

Ví Dụ

Kết quả:
Nhấn Ctrl + G để mở cửa sổ Immediate để xem kết quả.