VBA & Macro Problems

Capitalise Text After a Colon with a Word VBA Macro

Steven ParkerSteven Parker Nov 27, 2026 869 views

Question details

Capitalize the first letter of transcript text following each speaker name and colon.

Capitalize Text After a Colon with a Word VBA Macro
Product
Microsoft Word
Device & OS
not provided
Scenario
A transcript contains speaker names followed by a colon, a space, and lowercase text.
Observed behavior
Text such as "GEORGE: uh huh." should become "GEORGE: Uh huh."
Before you start

Open the transcript in Word and check that the text to change follows a colon and exactly one space. The macro below changes lowercase English letters immediately after that sequence.

Solution 1Recommended

Run a Word VBA macro to capitalize letters after colons

Use this method to update matching text throughout the main document automatically.

The macro searches for each colon followed by one space and changes the next character only if it is a lowercase English letter. It changes the actual text rather than applying an All Caps font effect.

1
Open the VBA editor

In Word, open the transcript, then select Developer > Visual Basic. If the Developer tab is hidden, enable it in Word's ribbon settings.

2
Insert a module

In the VBA editor, select Insert > Module and paste the following code: Sub CapitalizeAfterColon() Dim searchRange As Range Dim nextChar As Range Set searchRange = ActiveDocument.Content With searchRange.Find .ClearFormatting .Text = ": " .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = False End With Do While searchRange.Find.Execute Set nextChar = searchRange.Duplicate nextChar.Collapse wdCollapseEnd nextChar.MoveEnd wdCharacter, 1 If nextChar.Text Like "[a-z]" Then nextChar.Text = UCase$(nextChar.Text) End If Set searchRange = ActiveDocument.Range(searchRange.End, ActiveDocument.Content.End) Loop End Sub

3
Run the macro

Place the cursor inside the macro and select Run > Run Sub/UserForm, or use the Run button in the VBA editor.

4
Review the transcript

Return to the document and check examples such as "GEORGE: Uh huh." to confirm the changes.

Run a Word VBA macro to capitalize letters after colons
Scope of the macro: The macro searches the main document text, not separate areas such as headers, footers, or text boxes. It does not match colons followed by multiple spaces or tabs.
Edit transcripts in WPS Writer

Capitalize transcript entries manually in WPS Writer

Use Find in WPS Writer to locate colon-space sequences, then edit the following letters. This is a manual alternative, not a Word VBA macro.

  1. 1. Open the transcript: Open WPS Writer and select Open to choose your transcript document.
  2. 2. Find the separator: Open Find and enter a colon followed by a space, ": ", in the search field.
  3. 3. Capitalize each entry: Go to each match and replace the lowercase letter after the space with its uppercase equivalent.
  4. 4. Save the document: Select File > Save or Save As to keep the edited transcript in your preferred document format.
Find speaker entries that need capitalizationOpen and edit Microsoft Word DOC and DOCX filesUse familiar document editing toolsReview each change in context
microsoft office alternative - wps office

Frequently Asked Questions

Does the macro capitalize the whole word after the colon?

No. It changes only the first lowercase English letter after a colon and one space, leaving the rest of the word unchanged.

Will the macro work if there are two spaces after the colon?

No. The macro checks the character immediately after the first colon-space sequence. If that character is another space, it makes no change.

Does Word's All Caps font setting change the actual text?

No. You can apply All Caps through the Font settings, but it changes the text's appearance rather than converting the stored lowercase letters to uppercase.

Can I edit a Word transcript in WPS Writer instead?

Yes. Open the DOC or DOCX file in WPS Writer, use Find to locate colon-space sequences, and manually capitalize the following letters.