Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. 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

Written by Allen Wyatt (last updated April 24, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


5

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, many 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.

What Emily is referring to is variously know as a "serial comma" or an "Oxford comma." Its use has been debated for decades by grammarians. (I don't want to get into a debate about it here, but will say that the use of an Oxford comma can improve clarity when it comes to inline lists, as Emily notes.)

Emily is looking for a rather simple solution to the problem, one that will search for the common conjunctions and insert a comma, as necessary. The best way to handle this situation is with a macro, as she 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.

I recognize that this macro may not work for all grammatical permutations. (English is rather "squishy" that way.) It may be better to simply let Word check your document for you and flag anything that it questions when it comes to the presence of the Oxford comma (or lack thereof). You can make this change in this manner if you are using Word 2007, Word 2010, or Word 2013:

  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 or a later version, 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.

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 (9295) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. 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

Creating a Hyperlink that Opens the Linked Object

Hyperlinks can be very helpful for loading and displaying external resources. But they are less useful for opening and ...

Discover More

Generating Double-Digit Random Numbers

Normally you use the RAND and RANDBETWEEN functions to generate random numbers. What if you want to generate random ...

Discover More

Workbook Events

You can create macros that run whenever Excel detects a certain event happening within an entire workbook. This tip ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Removing Tabs Used to Indent a Paragraph

You get a document from a colleague and you notice that each paragraph starts with a tab character. Here are a couple of ...

Discover More

Inserting Dashes between Letters in Words

Sometimes typing isn't straight typing. Sometimes you need to perform special tasks, such as putting dashes between ...

Discover More

Multiple Document Users

If you have a group of people working on a single document, you may wonder what tools are available in Word to facilitate ...

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 two more than 7?

2022-09-17 13:25:31

James Martin

Interesting. Oxford comma seems pointless,I don't use it. We have a new political Minister in the UK, who has emailed staff to not use it, it has really annoyed them! I would use this though to annoy the Minister!


2018-09-19 10:25:24

Jennifer Thomas

Same concerns about this as in previous comments, so I tested it and it DOES put a comma before each 'And'.

Example:

My parents, Buddha and Maya Angelou are important influences in my life and work.

becomes

My parents, Buddha, and Maya Angelou are important influences in my life, and work.

Macros for grammar almost never work out as well as you hope because of the complexity of the language, so use your own brain as the primary resource for checking and turn on Grammar checker for assistance and a motivation to see if you really remember what your English teacher said all those years ago.


2018-09-18 03:45:25

Peter

I fail to see the point of having a macro that will put I so many incorrect commas. Surely the best way of achieving what is required is to use MS Word’s existing grammar checked to insert Oxford commas only where correct to do so? This is illustrated in Figure 4. The other huge advantage of MS Word’s own check is that you also get to choose on a case-by-case basis if the comma is inserted. The macro blindly puts them in everywhere.


2018-09-16 13:34:30

Bonnie Granat

For the macro, what happens if the text is "apples and oranges"? Is the macro going to put a comma after "apples"? We wouldn't want that.


2018-09-15 10:33:34

Carol Saller

Do I understand that this macro would put a comma before every "and" in your document (as long as there wasn't already some punctuation there)? There are normally many, many instances of "and" that must not be preceded by a comma. Wouldn't this macro cause just as much trouble as it would save? (As always, thanks for the continued Word Tips - I never miss a week!)


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.