Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. 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 August 3, 2015)

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 replace 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 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 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.

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 and 2010. 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

Getting Rid of Addresses

Word interfaces easily with other Office programs, such as Outlook. As an example, the Envelopes and Labels dialog box ...

Discover More

Changing Cell Colors

If you need to change the color with which a particular cell is filled, the easier method is to use the Fill Color tool, as ...

Discover More

Can't Empty the Clipboard

The Clipboard is essential to move or copy information from one place in Excel to another. If you get an error when you try ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Using Manual Line Breaks with Justified Paragraphs

If you use justified paragraphs, you know that if you press Shift+Enter, it can lead to some odd spacing between words and ...

Discover More

Wrapping Spaces

Add more than one space after the end of a sentence, and you may find that the extra spaces wrap to the start of new lines. ...

Discover More

Automatically Selecting Words

When editing a document, Word normally selects entire words as you use the mouse to select text. This tip explains why this ...

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 4 + 1?

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.