Site icon Excel Champs

VBA STRCONV Function (Syntax + Example)

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

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.

Exit mobile version