Changing Formatting for a Portion of Found Text

Written by Allen Wyatt (last updated January 4, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and 2021


Susan has a common need to search for very specific text and then change the formatting of only a portion of the text found. For instance, she may need to find "; provided, however" and, if found, underline the two words but not the punctuation or spaces. She can't figure out how to do this using Find and Replace.

There are two fast ways you can do this, and neither of those ways involve using a macro. If your entire need is to simply underline the words, then the first approach will work great in some versions of Word:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click the More button, if it is available. Word expands the Find and Replace dialog box. (See Figure 1.)
  3. Figure 1. The expanded Find and Replace dialog box.

  4. In the Find What box, type the unformatted text you want to locate. For instance, you would type "; provided, however" without the quote marks.
  5. In the Replace With box, type the exact same text you entered in the Find With box.
  6. With the insertion point still in the Replace With box, click the Format button and then choose Font. Word displays the Replace Font dialog box.
  7. Using the Underline Style drop-down list, choose Words Only. (See Figure 2.)
  8. Figure 2. The Replace Font dialog.

  9. Click OK to dismiss the Replace Font dialog box. You should notice the phrase Word Underline appears under the Replace With box. (See Figure 3.)
  10. Figure 3. Underlining just words in a replacement.

  11. Click on Replace All.

Word makes all the replacements, and just the desired words (provided and however) are underlined. Note, however, that at the beginning of these steps I noted that this approach would only work in some versions of Word. The reason is because some versions of Word include punctuation as part of a valid "word" when it comes to underlining in this manner. Thus, you end up with only the spaces not underlined. In other versions of Word, however, the punctuation is ignored and therefore not underlined. You'll obviously want to test this to see how your version of Word behaves.

If you do, indeed, end up with the punctuation underlined or if you need to do more complex formatting for the replacement text (for instance, you might need to not only underline but make the replacement words bold), then the second approach is best. Follow these steps:

  1. In your document, format the first instance of your "; provided, however" text exactly the way you want.
  2. Select the text you formatted in step 1.
  3. Press Ctrl+C. The text (including the formatting) is now copied to the Clipboard.
  4. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  5. In the Find What box, type the unformatted text you want to locate. For instance, you would type "; provided, however" without the quote marks.
  6. In the Replace With box, type ^c. (Make sure that is a lowercase "c.") This indicates you want to replace any matched text with the contents of the Clipboard. (See Figure 4.)
  7. Figure 4. Ready to do the replacements.

  8. Click on Replace All.

In doing the replacements, Word uses the formatted contents of the Clipboard, and you end up with the formatting you want for instances of the text.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13714) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and 2021.

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

Quickly Updating Values

If you need to update a bunch of values in a worksheet by a standard amount, you can use the Paste Special feature of ...

Discover More

Deriving a Secant and Cosecant

Two rather common trigonometric functions are secants and cosecants. Excel doesn't provide functions to calculate these, ...

Discover More

Ignoring Case in a Comparison

Do you want Excel to take the case of your text into account when it does comparisons in a formula? The IF statement ...

Discover More

Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!

More WordTips (ribbon)

Searching for Footnote and Endnote Marks

Do you want to quickly search for any footnote or endnote marks in your document? Word makes it easy using the standard ...

Discover More

Finding and Replacing Text Boxes

The Find and Replace capabilities of Word are very powerful, but they still come up a bit short when searching for some ...

Discover More

Applying a Character Style to Bracketed Text

Word has a powerful Find and Replace capability. It is even more powerful if you turn on its wildcard capability. Here's ...

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 3 + 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.