Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to change text strings to sentence case in Microsoft Excel?

You may need to change text strings to sentence case in Microsoft Excel. Supposing there are hundreds of text strings in uppercase or lowercase, changing them manually one by one is not a good choice. Are there easy tricks to change text strings to sentence case in Microsoft Excel?

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial

arrow blue right bubble Change text strings to sentence case in Excel with VBA

If you are experienced with Microsoft Excel, using VBA is a good choice to change text strings to sentence case.

Step 1: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert > Module, and paste the following macro in the Module window.

Sub SentenceCase()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
    xValue = Rng.Value
    xStart = True
    For i = 1 To VBA.Len(xValue)
        ch = Mid(xValue, i, 1)
        Select Case ch
            Case "."
            xStart = True
            Case "?"
            xStart = True
            Case "a" To "z"
            If xStart Then
                ch = UCase(ch)
                xStart = False
            End If
            Case "A" To "Z"
            If xStart Then
                xStart = False
                ch = LCase(ch)
            End If
        End Select
        Mid(xValue, i, 1) = ch
    Rng.Value = xValue
End Sub

Step 3: Press the F5 key to run this macro, then a dialog is popped up on the screen for selecting a range, see screenshot:


Step 4: Click Ok, and you can see the result as shown as below:

arrow blue right bubble Change text strings to sentence case in Excel with Kutools for Excel

Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Get it Now

VBA macro may be not easy for starter users of Microsoft Excel. Please do not worry about it. Kutools for Excel's Change Case tool can change all text strings to sentence case in selections quickly.

Step 1: Select the range in which you will change text strings to sentence case.

Step 2: Click the Kutools > Text Tools > Change Case…. See screenshot:

Step 3: In Change Case dialog box, check the Sentence Case. Option, and click OK or Apply button.

Then you will view all kinds of text strings are changed to sentence case in the selection. See the following figure:

Kutools for Excel's Change Case tool can quickly change text case to UPPER, LOWER, PROPER, Sentence Case, and tOGGLE cASE. Click to know more…

Relative articles:

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Screen Shot of Excel (with Office Tab installed)

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Manohar Packianathan · 2 years ago
    Here is simple way of converting any text with multiple sentences to Sentence Case. The comments on the right show how the text gets transformed at each step.

    Private Function SentenceConvert(strText As String) As String
    strText = LCase(strText) 'I GO. i went. --> i go. i went.
    strText = Replace(Replace(Replace(strText, ". ", ".~"), "? ", "?~"), "! ", "!~") 'i go. i went. --> i go.~i went.
    strText = Replace(strText, " ", "^") 'i go.~i went. --> i^go.~i^went.
    strText = Replace(strText, "~", " ") 'i^go.~i^went. --> i^go. i^went.
    strText = StrConv(strText, vbProperCase) 'i^go. i went. --> I^go. I^went.
    strText = Replace(strText, "^", " ") 'I^go. I^went. --> I go. I went.
    strText = Replace(strText, " i ", " I ")
    SentenceConvert = strText
    End Function
  • To post as a guest, your comment is unpublished.
    Bobbie · 4 years ago
    OR you could simply copy the selection to MS Word, change to sentence case there and copy back.
  • To post as a guest, your comment is unpublished.
    Gerry · 4 years ago
    Good macro, but it would help to have all the variables defined.
  • To post as a guest, your comment is unpublished.
    Alina · 5 years ago
    Really helpful! Thanks! :lol:
  • To post as a guest, your comment is unpublished.
    Joe Grant · 5 years ago
    Thanks for the great tutorial for the macro! I noticed though that any sentences following a sentence ending in an exclamation point did not get capitalized. How do I add this to the macro?