VBA Data Type Conversion Functions in Excel 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 VBA 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 |
Other Useful Resources:
Click on the following links of the useful resources. These helps to learn and gain more knowledge.
VBA Tutorial VBA Functions List VBA Arrays in Excel Blog
VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers
I got this web page from my buddy who informed me regarding this website and at
the moment this time I am browsing this web page and reading
very informative articles at this place.
Heya i am for the first time here. I found this board and I find It truly useful & it helped me out much.
I hope to give something again and aid others such as you aided me.
whoah this blog is wonderful i love studying your articles.
Stay up the great work! You recognize, a lot of individuals
are hunting around for this information, you could help them greatly.
Thanks for your valuable feedback!
I’m not sure exactly why but this blog is loading incredibly slow for me.
Is anyone else having this problem or is it a issue on my end?
I’ll check back later and see if the problem still
exists.