Skip to main content

 How to capitalize the first letter after colon in a Word document?

If you need to capitalize the first letters after colons in a Word document, to change them one by one manually will not be a good choice. This article, I will talk about a way to change the first lowercase letter to uppercase letter after the colons as quickly as possible.

Capitalize the first letters after colons with VBA code in a Word document


Capitalize the first letters after colons with VBA code in a Word document

The following VBA code can help you to make all the first letters uppercase after the colons in the whole Word document to capitalize, please do as this:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Capitalize the first letters after colons:

Sub CapitalizeWordAfterColon()
    Application.ScreenUpdating = False
    Selection.HomeKey wdStory
    With Selection.Find
        .ClearFormatting
        .Text = ": ([a-z])"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchWholeWord = False
        .MatchSoundsLike = False
        .MatchCase = False
        .MatchWildcards = True
        .MatchAllWordForms = False
        With .Replacement.Font
          .AllCaps = True
          .SmallCaps = False
        End With
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Application.ScreenUpdating = True
End Sub

3. Then, press F5 key to run this code, and all the first letters after the colons have been converted to uppercase letters at once, see screenshot:

doc capitalize first letter after colon 1

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

🤖 Kutools AI Assistant: Transform your writing with AI - Generate Content  /  Rewrite Text  /  Summarize Documents  /  Inquire for Information based on Document, all within Word

📘 Document Mastery: Split Pages  /  Merge Documents  /  Export Selection in Various Formats (PDF/TXT/DOC/HTML...)  /  Batch Convert to PDF  /  Export Pages as Images  /  Print Multiple Files at once...

Contents Editing: Batch Find and Replace across Multiple Files  /  Resize All Pictures  /  Transpose Table Rows and Columns  /  Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces  /  Section Breaks  /  All Headers  /  Text Boxes  /  Hyperlinks  /  For more removing tools, head to our Remove Group...

Creative Inserts: Insert Thousand Separators  /  Check Boxes  /  Radio Buttons  /  QR Code  /  Barcode  /  Diagonal Line Table  /  Equation Caption  /  Image Caption  /  Table Caption  /  Multiple Pictures  /  Discover more in the Insert Group...

🔍 Precision Selections: Pinpoint specific pages  /  tables  /  shapes  /  heading paragraphs  /  Enhance navigation with more Select features...

Star Enhancements: Navigate swiftly to any location  /  auto-insert repetitive text  /  seamlessly toggle between document windows  /  11 Conversion Tools...

👉 Want to try these features? Kutools for Word offers a 60-day free trial, with no limitations! 🚀
Free Download     Read More     Buy Now
 
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
ciao, è possibile fare l'esatto opposto? ovvero trasformare tutte le maiuscole dopo i due punti in minuscole? grazie in anticipo.
This comment was minimized by the moderator on the site
ciao, come si fa a fare l'esatto opposto?ovvero sostituire tutte le lettere maiuscole dopo i due punti in lettere minuscole?grazie in anticipo
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations