Find Long Sentences Instantly in Your Microsoft Word Docs

Long sentences, as you know, can make reading a slog. Do your readers a favor and keep most of your sentences under 30 words. And do yourself a favor—use technology to help. Use Microsoft Word to turn all your long sentences red so that they jump out at you, like this:

How? Use a macro. A macro is a chunk of code, some lines of text sitting quietly in a small file, waiting for someone to run it so that it can tell Word to do something. You don’t have to know anything about macros to do this; I’m about to walk you through the steps.

First, a few thoughts:

  • Don’t feel obligated to keep all your sentences under 30 words. A well-formed longer sentence may read just fine. Challenge yourself, though. Keep longer sentences only after you’ve cut all the words you can and experimented with breaking the sentence up.
  • If these instructions don’t match your version of Word, you can probably find the steps you need online. When my friend Anne Reed tried a similar macro, she said, “My version of Word uses a different path to create a macro, but the cut-and-paste still worked perfectly once I got there.”

Here’s how to create the macro and then run it in any Word doc.

Create the macro

This is what I do on my Mac. See my note below for Windows users.

  1. Open Word.
  2. If any Word documents are open, close them.
  3. In Word, go to the Tools menu, and choose Macro > Visual Basic Editor. A window opens with the title “Microsoft Visual Basic – Normal.”
  4. Go to the Insert menu, and choose Module. A blank document opens.
  5. Copy the macro—everything in the box below, from Sub to End Sub—and paste it into the blank document. Close Visual Basic Editor. Word automatically saves the macro.
Sub Mark_Long()
    Dim iMyCount As Integer
    Dim iWords As Integer

    If Not ActiveDocument.Saved Then
    End If

    'Reset counter
    iMyCount = 0 

    'Set number of words
    iWords = 30

    For Each MySent In ActiveDocument.Sentences
        If MySent.Words.Count > iWords Then 
            MySent.Font.Color = wdColorRed
            iMyCount = iMyCount + 1
        End If
    MsgBox iMyCount & " sentences longer than " & _
      iWords & " words."
End Sub

Credits: I learned about this gem of a macro, created by Allen Wyatt, from my colleague Dave May. Thanks, Allen. Thanks, Dave. I share this macro with Allen’s permission. His original word count is 20. I changed it to 30. You can delete the 30 and type any number you like.

Windows user? My friend Larry Kunz noted a while back that in Word 2016 on a PC, you find the macros dialog at Developer > Macros. To create the macro, fill in the macro name at the top, and choose Create to open Visual Basic Editor. 

Run the macro in any Word doc

This is what I do on my Mac. See my note below for Windows users.

  1. Open any Word doc you want to evaluate, or open a new Word doc and paste in text from another application.
  2. Go to the Tools menu, and choose Macro Macros.
  3. Choose Mark_Long. (That’s the name of the macro you just created.)
  4. Choose Run. Word instantly turns the text red in all sentences longer than 30 words.
  5. Edit each red sentence until you’re happy with it, and then turn that text black again.

Windows user? To run the macro, go back to Developer > Macros, choose the macro, and choose Run.

Bonus tip

As you edit, Word can show the count for any group of words you select. Here’s how to turn this feature on (at least in the version of Word I use on my Mac): right-click the bottom edge of any Word window, and choose Word Count. Then select a sentence, and look at at the bottom edge of the window. You’ll see something like “29 of 1664 words.”

Like this macro? Try this one too.

If you like this macro, you might also like the one I describe here: Instantly Highlight (Almost All*) Be-Verbs in a Microsoft Word Doc.

Let me know about your macro adventures!

6 thoughts on “Find Long Sentences Instantly in Your Microsoft Word Docs

  1. Thanks so much! I’m editing a 10k+ word document, so this has been invaluable to find the 150+ sentences buried therein. I’ve made a couple customizations to the code (I’m no programmer) which I thought may be helpful. I added the following to change sentences back to black once they’ve been fixed: ” Else: MySent.Font.Color = wdColorBlack ” and added a macro shortcut. Now I can re-run the macro so that I can slowly weed out the long sentences! Thanks again, T

  2. Hi, Jim. Thanks for this question. I wasn’t aware of this macro counting commas as words. I wonder why. I don’t know if it has changed. If you learn the answer, please come back and share it.

Comments are closed.