Breaking Into Sentences

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


4

Michael has documents that he needs to edit daily. These documents are "free flowing," with no sentence endings or beginnings. (They start out as raw transcriptions.) It would be very helpful to Michael if he could select a character and have a macro automatically make that character uppercase and go back two spaces to type a period. That would allow him to edit the documents much quicker than he otherwise could.

This type of need is tailor-made for addressing with a macro. Here is an example of a simple macro that will do exactly what Michael wants:

Sub BreakSentence()
    Selection.Range.Case = wdUpperCase
    Selection.MoveLeft Unit:=wdCharacter, Count:=2
    Selection.TypeText Text:="."
End Sub

In order to use it, simply select the character that is at the start of what you view as the new sentence. (Truth be told, you could probably get away with simply putting the insertion point just before that character.) Run the macro, and it performs the two tasks—making the letter capitalized and inserting a period.

The biggest assumption in this macro is that there is only a single space between each word. If there are multiple spaces, then you will need to "clean up" your text after the macro is run.

You can make the macro even more useful by assigning it to a shortcut key. This allows you to make your character selection, press the shortcut key, and then continue with your editing. How you assign a macro to a shortcut key is described in this WordTip.

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

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

Copying Red Text to a New Document

Need to copy all the red text in your document to a different document? There are several ways you can approach the task; ...

Discover More

Drawing a Curve

Ever wonder how to add a curved line to your document? With a little practice, adding curves is simple. Here's how.

Discover More

Using a Formula to Replace Spaces with Dashes

If you need a formula to change spaces to some other character, the SUBSTITUTE function fits the bill. Here's how to use it.

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)

Collecting Highlighted Text Selections

Got a document with text passages marked with the highlighter tool? You can collect all those highlighted selections and ...

Discover More

Using Go To with a Percentage

Need to jump a certain percentage of the way through a document? You can do it using the familiar Go To tab of the Find ...

Discover More

Moving Text without Affecting the Clipboard

Want a quick and easy way to move text (or other document elements) from one place to another in your document? Check out ...

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 5 - 5?

2023-11-30 16:40:17

Kiwerry

Apologies, the code below lost its indentation.


2023-11-30 16:38:54

Kiwerry

Thanks, Allen.
Some may prefer to select the word that starts a sentence by a double-click anywhere in it, rather than selecting the first character of that word, which can be more fiddly. They could use something like this :
Sub Capitalise_Word_add_Fullstop()
Selection.Range.Case = wdTitleWord
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="."
End Sub


2019-09-03 10:01:28

Shelley List

Just one thing: unless you're using a monospace font like Courier New, you should have only one space after a period—not two!


2019-08-31 10:45:13

Gordon Bennett

I'm completely new at macros, but need them badly. At the moment, it would be great to get code for creating columns of sequential numbers. I need code to select the last number in the previous sequence, add one to it, then generate the next column. Each column has 40 numbers. I have purchased Excel Macros by Hein Smith, and began trying to learn from it for the past couple of days, but it isn't going well. I have an iMac, which I suspect may be part of the problem.


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.