Contents hide
The VBA STRCONV function is listed under the text category of VBA functions. When you use it in a VBA code, it can convert a string into a specified format. There is a total of 9 different types of formats that you can convert to.
Syntax
StrConv(String, Conversion, [LocaleID])
Arguments
- String: The string you want to convert.
- Conversion: A VbStrConv enumerator specifies the type of conversion that is to be made.
- [LocaleID]: The localeID to be used [This is an optional argument and if omitted VBA takes system LocaleID by default].
Example
To practically understand how to use the VBA STRCONV function, you need to go through the below example where we have written a vba code by using it:
Sub example_STRCONV()
Range("B1").Value = StrConv(Range("A1"), vbProperCase)
End Sub
In the above code, we have used the STRCONV to convert the string that we have in cell A1 into a proper case string.
More Tutorials
⇠ Back to VBA Function List | What is VBA in Excel
Helpful Links – Developer Tab – Visual Basic Editor – Run a Macro – Personal Macro Workbook – Excel Macro Recorder – VBA Interview Questions – VBA Codes