Share via

How can I get a word count for each section in a Word document?

Oren Lifshitz 40 Reputation points
2025-07-20T18:48:59.5733333+00:00

Hi,

I'm working with a large Word document that's broken into many sections. Is there an easy way to get a word count for the words in each section, without having to select each section individually?

Thank you,

Microsoft 365 and Office | Word | For business | Windows

Answer accepted by question author

HansV 462.6K Reputation points
2025-07-20T19:20:32.62+00:00

Word does not have a built-in way to do that. You might run the following macro (a modification of the code in https://word.tips.net/T000519_Word_Count_for_a_Section.html)

Sub WordCount()
    Dim NumSec As Long
    Dim S As Long
    Dim Summary As String
    NumSec = ActiveDocument.Sections.Count
    Summary = "Word Count" & vbCrLf
    For S = 1 To NumSec
        Summary = Summary & "Section " & S & ": " & _
            ActiveDocument.Sections(S).Range.ComputeStatistics(wdStatisticWords) & _
            vbCrLf
    Next S
    Summary = Summary & "Document: " & _
        ActiveDocument.Range.ComputeStatistics(wdStatisticWords)
    MsgBox Summary
End Sub

Was this answer helpful?

3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.