The Novel Craft Blog

How to Compile Your Chapter Word Counts: A Macro for Fiction Authors

by | Oct 23, 2023 | Editing, Word Tutorials | 2 comments

Fiction manuscripts tend to be huge documents. When you’re editing such a large text, it can be helpful to get an overview of how that text is currently structured. You can do that with a list of your chapter word counts. Among other things, this list of chapter word counts can help you flag unusually long or short chapters.

It can be quite tedious, though, to manually highlight each chapter and record its word count. Luckily, you don’t need to. With the right tools in place, you’ll be able to compile your chapter word counts within seconds.

The tool that I’m referring to is called a macro. Macros are pieces of code you can add to Microsoft Word. They allow you to add custom features to Word. If you’re looking for a full tutorial on how to run and install macros generally, then check out this previous post.

I also have another post that recommends four additional macros for fiction writers. You can find that article here.

In this post, I’ll give you a detailed tutorial on how to run the Headings Word Count macro specifically.

What This Macro Does

The Headings Word Count macro creates a table at the end of your document. This table contains the name of all your headings (i.e., chapter marks) and the exact word count of the text beneath each heading. In other words, this macro allows authors to get a complete list of their chapter word counts.

I found this macro here on the Microsoft Community forum under the name “Count Heading Span Text” macro. That name is a bit clunky, so I’ve given the code a simpler name: the Headings Word Count Macro. I’ve also made tweaks to the code that macropod suggested. This version of the code lists the heading as well as the page counts. It also outputs the table at the end of the document. That way, you can save the table or paste it into another program such as Excel.

The Macro Code

Without further ado, here’s the code:

Sub Headings Word Count()
Application.ScreenUpdating = False
Dim RngHd As Range, h As Long, strOut As String
h = CLng(InputBox("Input the Heading level (e.g. 1) for the heading spans to count", "Heading Span Word Counter", 1))
If (h < 1) Or (h > 9) Then Exit Sub
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Style = "Heading " & h
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    Set RngHd = .Paragraphs(1).Range
    Set RngHd = RngHd.GoTo(What:=wdGoToBookmark, Name:="\HeadingLevel")
    With RngHd
      strOut = strOut & .ComputeStatistics(wdStatisticWords) - .Paragraphs.First.Range.ComputeStatistics(wdStatisticWords) & vbTab & .Paragraphs.First.Range.Text
    End With
    .Start = RngHd.End
    .Find.Execute
  Loop
End With
Set RngHd = Nothing
ActiveDocument.Range.InsertAfter vbCr & "The following word counts are associated with each level " & h & " heading:" & vbCr & strOut
Application.ScreenUpdating = True
End Sub

Again, if you want to learn how to install and run macros, check out my blog post How to Install and Run Macros in Microsoft Word.

How Fiction Writers Can Use This Macro

A list of chapter word counts can provide a quick overview of your story’s structure. If you’re looking for a target, know that adult fiction chapters are typically around 1,500 to 3,000 words long. Still, unusual structure can be justified if it’s serving your story. All writing rules are best treated as guidelines rather than actual rules.

That being said, wonky word counts are often a red flag for pacing issues. Also, readers generally appreciate being able to predict how long a chapter will take to read. If you have highly unusual or inconsistent chapter lengths, you also risk irritating your reader. So, if you’re going to have unusual structure, you need to make sure that it really is necessary and serving your story well. That’s where a chapter word count list can be a helpful editing tool.

Also, elsewhere on my blog, I’ve introduced an exercise that can help you identify slow or boring scenes. You can find that tool in my post, Eradicating Reader Boredom: How to Hook Your Reader and Never Let Go. As part of that exercise, you need to make list of all your chapter word counts. This macro will make that part of the exercise so much faster to do.

How to Navigate This Macro’s Unique Quirks

For this macro to work, you need to first do a couple of things to prepare your manuscript. Namely, you’ll need to use Microsoft Word’s style feature to set all your chapter titles as headings. If you are unfamiliar with Microsoft styles, that previous sentence probably meant little to you. So, here’s a quick overview of how styles work so you can use them.

How to Set Your Chapter Titles as Headings

To set all your chapter titles to the same heading level, first open your manuscript in Word. Then look at the top bar and make sure the “Home” tab is selected. Once you’ve selected “Home,” then you should see a section labelled “Styles” in the centre of the bar. Within that section, you’ll see different boxes of styled text. These styles should be labelled things like “Normal,” “Heading 1,” “Heading 2,” “Heading 3,” and so on. You’ll need to find those styles labelled “Heading #.” If you cannot see the heading styles right away, then use the arrows at the right of the box to scroll down until you find them.

Here’s an example of what this “Styles” section can look like in Microsoft Word:

This is an image of Microsoft Word's home tab and styles section.

Once you’ve found the heading style you want to use, then click on your chapter title. Then select your chosen heading style in the bar above. Your chapter title’s format will change to match the heading’s style. It will also be invisibly marked as a heading within Word’s code. You’ll need to repeat this process with all the chapter titles in your manuscript.

You can double-check your work by selecting Ctrl + F (Cmd + F on Mac). A new panel will appear on the left. Select “Headings,” and you should find a complete table of contents that now lists all your chapters. You can also use this panel to click on a chapter title and immediately go to that location in the document.

Here’s another example of what this headings panel can look like in Microsoft Word:

This is an image of Microsoft Word's navigation panel and headings tab.

If you would like to change the font, size, and colour of the heading, you can do that. Simply format the text as you would like it to appear. Then select the text, right-click on the heading level you would like to use, and select “Update Heading # to Match Selection.” Then Word will change the heading style to match your custom choices.

Here’s what this process can look like in Microsoft Word:

This is an image of the drop-down menu in Microsoft Word that you can use to customize your styles.

Word styles are such a useful navigation and stylization tool. So, I recommend using them to format your manuscript even if you don’t plan on using this macro.

How to Run the Macro

Once all your chapter titles are set to the same heading level, you are ready to run the macro. When you hit “Run,” this window will open up:

This is an image of the pop-up menu that will appear in Microsoft Word when you run the Headings Word Count macro. The text of the box reads, "Input the Heading level (e.g. 1) for the heading spans to count." There is a bar at the bottom of the window where you can type in the numeral of your heading level. There are also two buttons: an "OK" button and a "Cancel" button.

To pick your chosen heading level, simply put the number of the heading level into the bar at the bottom of the window. Then hit “OK.” At the bottom of your document, a new table will appear with all your chapter titles and their respective word counts.

Now it’s up to you to decide how to use this data in your editing process.

I hope you’ve found this tutorial helpful. I’m going to keep posting tutorials on different macros for fiction authors. So, you can sign up for my monthly newsletter below to make sure you don’t miss any upcoming posts.

As always, happy writing, everyone!

About the Author

About the Author

I’m Amelia Winters, a professional fiction editor, language nerd, and story aficionado. By night, I chase stories and explore distant worlds through books, role-playing games, and sewing my own historical garments. By day, I journey with authors to help them hone their story craft, elevate their voice, and polish their prose.

To learn more about my editing services, click here.

2 Comments

  1. prabhleen

    I love the article!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This