A.3. Data Type Conversion Functions

CBool Function

Returns a Boolean data type

CByte Function

Returns a Byte data type

CCur Function

Returns a Currency data type

CDate Function

Returns a Date data type

CDbl Function

Returns a Double data type

CDec Function

Returns a Decimal data subtype

CInt Function

Returns an Integer data type

CLng Function

Returns a Long data type

CSng Function

Returns a Single data type

CStr Function

Returns a String data type

CVar Function

Returns a Variant data type

CVDate Function

Converts expression to Date

CVErr Function

Converts expression to Error

Error Function

Returns an error message as a variant

Error$ Function

Returns an error message as a string

Fix Function

Returns an Integer portion of number

Hex Function

Returns a hexadecimal representation of number as a variant

Hex$ Function

Returns a hexadecimal representation of a number as a string

Int Function

Returns the integer portion of a number

Oct Function

Returns an octal representation of a number as a variant

Oct$ Function

Returns an octal representation of a number as a string

Str Function

Returns a string representation of a value as a variant

Str$ Function

Returns a string representation of a value as a string

Val Function

Returns the Double value of a string representation of a number

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.