Counting Lists

Written by Allen Wyatt (last updated December 7, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


2

Michele needs a way to count the number of bulleted lists or the number of numbered lists in a document. She wonders how this could be accomplished in Word.

This is a bit harder than one might imagine, the bottom line being that we can find no way to generate a count reliably. The reason for this may take a bit of explaining.

There are multiple ways you can add styles to your document. For instance, you could click on either the Numbered List or Bulleted List tools on the Home tab of the ribbon to convert the current paragraph (or paragraphs) to a list. You could also start typing and allow Word to detect (via AutoFormat As You Type) whether you are creating a numbered list or a bulleted list. You could even define and apply styles that designate what you want used as a list.

Regardless of the way you create your lists, Word associates a style with the paragraphs in the list. If you create and apply your own style, then that particular style is (of course) used. If you use the toolbar buttons or rely on AutoFormat to create the lists, then Word automatically applies the List Paragraph style. (Yes, it uses the exact same style regardless of whether it is a numbered or bulleted list.)

Since styles are associated with the list, you can quickly determine how many instances of the style are in use. All you need to do is to display the Styles task pane (display the Home tab of the ribbon and click the small icon at the bottom-right of the Styles group). Locate the style used for your lists, hover the mouse pointer over that style name, and then click the down-arrow that appears to the right of the name. You'll see something similar to one of the following appear:

  • Select All: (No Data)
  • Select All X Instance(s)

If what you see matches the first format, then select that option. When you hover over the style name and click the down-arrow again, what you see should match the second format.

You might think that this shows you the number of lists in your document. It doesn't; it only shows you the number of paragraphs formatted with this particular style. Thus, if you have a single list that is comprised of 6 items, then the style count returned will be 6. Thus, this approach—counting styles—doesn't provide a reliable way to determine a list count.

The other way you might consider is to use a macro to determine how many lists are in your document. Word maintains a Lists collection and makes it available to VBA. You can step through each list in the document and examine its ListType property. This property can actually be one of seven different values, as indicated by the following enumerations:

  • wdListBullet
  • wdListListNumOnly
  • wdListMixedNumbering
  • wdListNoNumbering
  • wdListOutlineNumbering
  • wdListPictureBullet
  • wdListSimpleNumbering

You can probably figure out what each of these lists types entails, but how they play out in reality can be a bit perplexing. As an example, consider the following macro:

Sub CheckLists()
    Dim oL As List
    Dim sMsg As String
    Dim J As Integer
    Dim K As Integer

    J = ActiveDocument.Lists.Count
    For Each oL In ActiveDocument.Lists
        K = K + 1
        oL.Range.Select

        sMsg = "This is list " & K & " of " & J
        sMsg = sMsg & " lists in the document." & vbCrLf & vbCrLf
        sMsg = sMsg & "This list is this type: "
        Select Case oL.Range.ListFormat.ListType
            Case wdListBullet
                sMsg = sMsg & "wdListBullet"
            Case wdListListNumOnly
                sMsg = sMsg & "wdListListNumOnly"
            Case wdListMixedNumbering
                sMsg = sMsg & "wdListMixedNumbering"
            Case wdListNoNumbering
                sMsg = sMsg & "wdListNoNumbering"
            Case wdListOutlineNumbering
                sMsg = sMsg & "wdListOutlineNumbering"
            Case wdListPictureBullet
                sMsg = sMsg & "wdListPictureBullet"
            Case wdListSimpleNumbering
                sMsg = sMsg & "wdListSimpleNumbering"
        End Select
        MsgBox sMsg
    Next oL
End Sub

If you have a document that contains lists and run this, it will select each list, in turn, and display a message box that shows what type of list Word thinks the selection represents. The problem is, if your text contains two lists interspersed by a paragraph or two of text, Word considers it a single list of the wdListMixedNumbering type. In other words, it doesn't accurately figure out what is a list and what isn't a list. This makes this particular approach unreliable for counting how many lists are in your document, although it is more accurate than using the count-the-styles approach.

The bottom line, as mentioned at the beginning, is that there is no way that we can determine to accurately count the number of bulleted and numbered lists in a document.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13528) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Double-Spacing Your Document

Need to produce a quick double-spaced printout of your document? You can do it by using the simple steps in this tip.

Discover More

Printer Won't Print Envelope Font

The default font used for envelopes is called Callibri. What do you do if you cannot print that font on your printer? ...

Discover More

Calculating Time Differences between Two Machines

Want to know how much of a time difference there is between your machine and a different machine? This tip provides some ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Removing a List

If you have lists in your document, either bulleted or numbered, you may want to change them back to regular text at some ...

Discover More

Understanding and Creating Lists

There are two types of common lists you can use in a document: bulleted lists and numbered lists. This tip explains the ...

Discover More

Converting List Types

There are two types of common lists you can create in Word: bulleted lists and numbered lists. You can switch between the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2024-12-09 11:27:25

Andrew

A couple of thoughts:

1. I disagree that a list interspersed with non-list paragraphs shouldn't be considered a single list. In my opinion, a single list should comprise a single uninterrupted number schema -- e.g., why shouldn't a single list item be able to contain multiple paragraphs, a table, etc.?

2. Ditto what Ken Endacott said. On reading this post, I immediately thought there must be a heuristic way to do a count, so I though, why not just count the number of paragraphs that are first in a list. Well ... I quickly ran into 1) Ken's issue regarding infinite list formats; 2) Word's making it easier to identify "last" paragraphs as opposed to "first" paragraphs (e.g., if LP is a Paragraph in the ActiveDocument.ListParagraphs collection, testing for LP.Range.CanContinuePreviousList(LP.Range.ListTemplate) = wdContinueDisabled) -- not a problem in and of itself, for single "list" a "disabled" continuation is signaled at each change of level; 3) etc. etc.

Andy.


2024-12-08 02:56:17

Ken Endacott

Microsoft have excelled themselves in the implementation of List numbering. It is complex, inconsistent and difficult to use. The complexity increased ten fold when they introduced numbering buttons on the Home ribbon.

Several thousand lines of VBA code and many hours of work and I have ended up with comprehensive macros that pull apart lists and identify the paragraphs and styles to which they apply.

A surprise is that new List Templates are created just about every time changes are made, the old ones are never deleted but just sit there unused. I have seen a heavily edited document with over 200 dormant List Templates.


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.