Studies show that good grammar leads to more promotions and higher salaries. Write with Grammarly

Convert String to Proper Case in Excel VBA

In this post, you will learn how to convert String to proper case with-in your Excel spreadsheet using Excel VBA

Convert String to Proper Case in Excel VBA

To convert a string of text into proper case, you can use the StrConv function .

 The StrConv function has two arguments. The first part of argument is the original string and the second part is the conversion case (Lower case, Upper case, Proper case).

Example program for converting a string to proper case in Excel VBA.

Code:

Sub Convert_To_ProperCase():
Dim Text As String
Dim ProperCase As String
Text = "cOnVeRting string to PrOpEr Case fUnctIon"
ProperCase = StrConv(Text, vbProperCase)
MsgBox ProperCase
End Sub
Convert String to Proper Case in Excel VBA - Developer Publish