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

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn how to Find Blank cells in excel so that you can remove or delete the blank cells form...
In this article, you’ll learn what is a Gauge Chart in Microsoft Excel. Also, you will learn how to add...
Microsoft Excel provides a shortcut for the users to move columns in excel using two different ways – using Shift...