VBA STRCONV Function

HomeVBA Functions LIST (Category Wise)How to use the VBA STRCONV Function (Syntax + Example)

What is VBA STRCONV Function

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 are total of 9 different types of formats that you can convert to.

how to use it

To use VBA's STRCONV function you need to understand its syntax and arguments:

Syntax

StrConv(String, Conversion, [LocaleID])

Arguments

  • String: The string you want to convert.
  • Conversion: A VbStrConv enumerator to specify 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 use STRCONV Function in VBA

To practically understand how to use 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 the cell A1 into a proper case string.

Related Functions

About the Author

puneet one point one

Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.