Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. 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: Automatic Non-breaking Spaces in Dates.
Written by Allen Wyatt (last updated September 30, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021
When you enter a date into a document, it would be very handy for Word to automatically place a non-breaking space between the month and the day of the month. Thus, "January 22" would have a non-breaking space between the "y" and the "2". In this way, the month and day would always appear together on the same line.
Unfortunately, Word doesn't do this by default. This means that you have several different ways you can use Word's built-in tools to solve the situation.
The first possible solution is to try using Word's AutoCorrect feature. This feature is not well suited for doing this task, however. Why? Because AutoCorrect only kicks in after Word figures you are finished with a word—in other words, when you type the space after the word or some other terminating character, such as a punctuation mark. Thus, if you wanted to replace "January" with "January" followed by a non-breaking space, you would actually end up with two spaces after the word—the non-breaking space in the replacement text and the space you typed in the course of, well, typing.
This brings us to the next potential solution—Building Blocks. This solution actually can work very well, but it requires some differences in how you type dates. The best solution is to create 12 Building Blocks, each saved under the three-character name of the 12 months. Thus, the entry for "jan" would be "January" followed by a non-breaking space.
Why use three characters instead of more? Because Word has another feature called AutoComplete. If AutoComplete is turned on (and it is turned on by default), then Word tries to "guess" what you are typing and suggest the rest of the word or phrase. It does this automatically for dates, but it doesn't kick in until you type the fourth character in a month that is longer than five characters. Thus, Word suggests "January" as a completion when you type "Janu", but it won't suggest "March" as a completion when you type "Marc".
If you use three characters for your month-and-non-breaking-space combination, then you can type "Jan" and press F3, resulting in the desired combination, without extra spaces. The change in how you type, of course, is that you must remember to only type three characters and then press F3.
If you don't like to remember such changes in how to type, you can easily create a macro that will go through a document and replace any spaces following a month name with a non-breaking space. The following is very handy for this purpose:
Sub MonthsWithNonBreakingSpaces() Dim sMonth As String Dim iMonth As Integer Selection.HomeKey unit:=wdStory For iMonth = 1 To 12 With Selection.Find .ClearFormatting .Text = "(" & MonthName(iMonth, False) & ")( )([0-9])" .MatchWildcards = True With .Replacement .ClearFormatting .Text = "\1^s\3" End With .Execute Replace:=wdReplaceAll End With Next iMonth End Sub
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11186) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Word here: Automatic Non-breaking Spaces in Dates.
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!
Word provides access to a wide variety of characters either from the keyboard or from the Symbol dialog box. Up and above ...
Discover MoreNeed to quickly count a group of items in a document? Here's a drop-dead easy way to get that count.
Discover MoreWhen you are navigating around your document, you may find it helpful to jump a certain number of pages either toward the ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-10-02 12:08:48
Shelley List
The trouble with pressing F3 every time is...pressing F3 every time.
For my money, it might be even easier to simply hit shift-space for that space between the month and day. Shift-space creates a nonbreaking space.
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments