VBA Data Type Conversion Function

VBA Data Type Conversion Functions

VBA Data Type Conversion Functions:

VBA Data Type Conversion Functions can be use to convert numeric values or strings to another specified format. These are CBool,CByte, CCur, CDate, CDbl, CDec, CInt, CLng, CSng, CStr, CVar etc. These functions are Built-In functions. We can use these VBA data type conversion functions in either procedure or function. These functions we use in the VBA editor window in Excel. These data type conversion functions you can use any number of times in VBA macro codes. We can use these multiple data type conversion functions in one statement.

List of Data Type Conversion Functions in Excel VBA:

Here are the list of Data Type Conversion functions. And also find its syntax and return type.

Function Description Syntax Return Type
VBA CBool VBA CBool function converts an expression to a Boolean data type. CBool(Expression) Boolean
VBA CByte VBA CByte function converts an expression to a Byte data type. CByte(Expression) Byte
VBA CCur VBA CCur function converts an expression to a Currency data type. CCur(Expression) Currency
VBA CDate VBA CDate function converts an expression to a Date data type. CDate(Expression) Date
VBA CDbl VBA CDbl function converts an expression to a Double data type. CDbl(Expression) Double
VBA CDec VBA CDec function converts an expression to a Decimal data subtype. CDec(Expression) Decimal
VBA CInt VBA CInt function converts an expression to an Integer data type. CInt(Expression) Integer
VBA CLng VBA CLng function converts an expression to a Long data type. CLng(Expression) Long
VBA CSng VBA CSng function converts an expression to a Single data type. CSng(Expression) Single
VBA CStr VBA CStr function converts an expression to a String data type. CStr(Expression) String
VBA CVar VBA CVar function converts an expression to a Variant data type. CVar(Expression) Variant

List of VBA Functions:

Please click on below link to go back to see all List of VBA Functions.

Quick View of VBA Data Type Conversion Functions List of VBA Functions

Leave a Comment

Your email address will not be published. Required fields are marked *