Written by Allen Wyatt (last updated November 29, 2025)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365
Part of Olivia's responsibility as an editor is to pay particular attention to paragraphs that have a large number of words, determining if they can be simplified. She wonders if there is a way to somehow "flag" paragraphs that contain more than, say, 125 words.
This is most easily done with a macro. Here's a very simple example that will do exactly what Olivia requests:
Sub CheckParagraphLength1()
Dim p As Paragraph
For Each p In ActiveDocument.Paragraphs
With p.Range
If .Words.Count > 125 Then .HighlightColorIndex = wdYellow
End With
Next p
End Sub
The macro steps through each paragraph in the document and, if it contains more than 125 words, highlights it in yellow. This will make it easy to locate the offending paragraphs.
If you want to change the threshold at which highlighting is done, then a more robust version of the macro is called for:
Sub CheckParagraphLength2()
Dim p As Paragraph
Dim sInput As String
Dim lMaxWords As Long
Dim iParCount As Integer
Do
sInput = InputBox( _
Prompt:="Maximum number of words allowed in a paragraph:", _
Title:="Paragraph Length Check")
If sInput = "" Then Exit Sub
If IsNumeric(sInput) Then
lMaxWords = CLng(sInput)
If lMaxWords >= 25 Then Exit Do
End If
MsgBox "Enter a value of 25 or greater.", vbExclamation, "Invalid Value"
Loop
iParCount = 0
For Each p In ActiveDocument.Paragraphs
With p.Range
.HighlightColorIndex = wdNoHighlight
If .Words.Count > lMaxWords Then
.HighlightColorIndex = wdYellow
iParCount = iParCount + 1
End If
End With
Next p
MsgBox iParCount & " paragraphs were highlighted.", vbInformation, "Finished"
End Sub
When this version is run, the user is asked to enter the number of words to be used as the threshold. The prompt will repeat until the user enters a value of at least 25 words. If the input field is left blank, then the macro is cancelled. When the macro is complete, the user is shown a message box that indicates how many paragraphs were highlighted.
Speaking of highlighting, it should be noted that either of these macros will mess up or remove any highlighting already in the document. If you use highlighting for a different purpose, then the macro would need to be changed to flag paragraphs in some other way, such as by adding some text at the beginning of the document.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10141) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.
Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!
Word does a pretty good job of figuring out what apostrophes to use around your text. There may be times, however, when ...
Discover MoreIf you get tired of documents that always seem to have extra spaces at the end of lines, here's a quick way to get rid of ...
Discover MoreTired of pressing the Delete or Backspace key for every character you want to delete? Here's a way you can make your ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments