Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Adding Serial Commas in a Sentence.

Adding Serial Commas in a Sentence

by Allen Wyatt
(last updated June 18, 2018)

7

One of the most common issues faced by Emily when editing involves the insertion of the serial comma in an in-line list of items, before the final conjunction between list items. Emily's office enforces the use of the serial comma for clarity and to avoid such potentially awkward phrasings as, "I dedicate this book to my parents, Mother Teresa and Jesus." However, most writers do not like to use this comma, so Emily spends a good amount of time editing it into almost every paragraph of text she comes across. Emily notes that it would make her life easier if she had a macro that would search from the insertion point to the end of the current sentence and insert a comma before the next occurrence of the common conjunctions "and" and "or", but only if there is no comma already there.

The best way to handle this situation is with a macro, as Emily notes. Here is one that will perform the task:

Sub SerialComma()
    Dim MySelection As Selection

    Selection.MoveRight Unit:=wdSentence, Extend:=wdExtend
    Set MySelection = Selection
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "([!,.?;:]) and "
        .Replacement.Text = "\1, and "
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchCase = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    MySelection.Select
    With Selection.Find
        .Text = "([!,.?;:]) or "
        .Replacement.Text = "\1, or "
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    MySelection.Select
    Selection.Collapse
End Sub

The macro first selects everything from the current insertion point to the end of the current sentence. Then, using a wild card search, it searches for an occurrence of the word "and" that doesn't follow a punctuation mark. If it finds it, it replaces the occurrence with a comma and the word "and". It will then do a similar search-and-replace operation for the word "or".

This macro can, of course, be assigned to a shortcut key or the Quick Access Toolbar to make adding this type of comma a snap.

Another configuration change you might want to do is to tell Word that you want to have it mark as incorrect any missing commas in your inline lists. You can make this change in this manner:

  1. Display the Word Options dialog box. (In Word 2007 click the Office button and then click Word Options. In Word 2010 or Word 2013 click the File tab of the ribbon and then click Options.)
  2. Click the Proofing option at the left side of the dialog box. (See Figure 1.)
  3. Figure 1. The Proofing options of the Word Options dialog box.

  4. Click the Settings button. Word displays the Grammar Settings dialog box. (See Figure 2.)
  5. Figure 2. The Grammar Settings dialog box.

  6. Make sure the "Comma Required before Last List Item" option is set to Always.
  7. Click on OK to close the Grammar Settings dialog box.
  8. Click on OK to close the Word Options dialog box.

If you are using Word 2016, use the following steps instead:

  1. Display the File tab of the ribbon and then click Options.
  2. Click the Proofing option at the left side of the dialog box. (See Figure 3.)
  3. Figure 3. The Proofing options of the Word Options dialog box

  4. Click the Settings button. Word displays the Grammar Settings dialog box.
  5. Scroll down to the bottom of the dialog box to display the Punctuation Conventions option. Make sure the Oxford Comma is selected. (See Figure 4.)
  6. Figure 4. The Oxford Comma Selected in Grammar Settings dialog box

  7. Click on OK to close the Grammar Settings dialog box.
  8. Click on OK to close the Word Options dialog box.

The setting won't insert the last comma for you, but it will catch those instances where the comma is not present.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9295) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Adding Serial Commas in a Sentence.

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

Counting Open Document Windows

When creating macros, it is sometimes necessary to know how many documents are open in Word. This is relatively easy to ...

Discover More

Using the Function Key Display Toolbar

Need to know what various function keys do? One easy way to find out is to use the Function Key Display toolbar, ...

Discover More

Conditional Printing

If you need to make what Excel prints be based upon conditions in a worksheet, you'll love the information in this tip. ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Checking for Matching Parentheses

There are lots of little "gotchas" that can make the difference between a finished document and a polished document. One ...

Discover More

Finding Long Sentences

For certain types of writing, you may want to make sure that the sentences in your document do not exceed a certain ...

Discover More

Putting Character Codes to Work

If you know the character codes for some characters of interest, you can use those codes to do lots of tasks. This tip ...

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}] 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 seven more than 3?

2014-03-27 08:02:50

PeterJ

One final thought.

The macro quoted will put commas in where grammatically they are incorrect. Microsoft’s implementation in the grammar checker is likely to be more reliable. Therefore, I’d suggest using the built-in MS Word function.


2014-03-27 07:58:08

PeterJ

George,

You are correct in your assumption. You can chose between "always", "never", and "don't check".

This so called 'Oxford Comma' causes quite a lot of debate e.g. see http://www.intelligentediting.com/forum/viewtopic.php?f=4&t=56

Many style guides insist that the Ocford comma is used (even those that say use UK English).


2014-03-27 05:29:39

George P

All very interesting. However, working as I do with UK English I'm more likely to need to DELETE serial commas. Can I assume that I could uncheck 'comma required' for an opposite effect?


2014-03-26 12:04:00

Art Hendrickson

PeterJ

'Comma required before last item' is most likely part of HKEY_CURRENT_USERSoftwareMicrosoftOffice<word version>WordData, although Data is just a collection of setting without details.

You may display the grammar setting dialog box with Dialogs(wdDialogToolsGrammarSettings).Show. Use Word's help to learn more about using dialog boxes.

Unfortunately, I was not able to find details of individual settings of this dialog box. Word's help indicates none of them are exposed.

Not much help, I know.


2014-02-13 08:25:04

PeterJ

Does anyone know where MS Word stores the value of the flag 'Comma required before last item'?
The article http://office.microsoft.com/en-001/word-help/select-grammar-and-writing-style-options-HP010354284.aspx describes how to use it but not where to get at it from VBA code.


2013-03-04 13:47:49

John

Has anyone discovered a way to solve the problem that Glenn mentions? As it stands, this macro creates as large a problem as it solves. In fact, it creates a larger problem, since lists of two are more common than lists of more than two.


2012-01-03 13:27:26

Glenn Case

One issue with the macro as written is that it does not distinquish between a list of two items (in which case the comma is not needed) and a list of more than one item. This may result in incorrect application (such as "I just did this, and that.")

I wonder if there is a way for a macro to work with the Grammar settings to identify cases where the comma is required, and insert it? This would allow a macro to process an entire document vs having to do it by occurence.


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.

Newest Tips
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.