Replacing and Formatting at the Same Time

Written by Allen Wyatt (last updated July 9, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


1

Patrick has a document in which there are "start" and "stop" character sequences that indicate where italics should begin and end. For instance, in the text sequence "$$$This is some text!$!" the "$$$" indicates the start of italics and the "!$!" indicates the end. Patrick wonders if there is a way he can use Find and Replace to (1) remove the character sequences and (2) format the text between those character sequences to italics.

This type of Find and Replace may sound difficult, but Word actually makes it quite easy, provided you use wildcards in your F&R operation. Follow these steps:

  1. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box.
  2. Click the More button, if it is visible.
  3. Make sure the Use Wildcards check box is selected.
  4. In the Find What box, enter "$$$(*)\!$\!" (without the quote marks).
  5. In the Replace With box, enter " \1" (again, without the quote marks). This tells Word to use, as replacement text, the first occurrence of text within parentheses in the pattern denoted in step 4.
  6. With the insertion point still in the Replace With box, press Ctrl+i. (This tells Word that you want the replacement text to be formatted as italics.)
  7. Click on Replace All.
  8. Close the Find and Replace dialog box.

That's it; only a single find-and-replace operation is needed. The "find" pattern (in step 4) indicates you want to find anything (*) surrounded by your indicated markers. Important! that the backslashes before the exclamation marks in step 4 are important, as they cause the characters to be treated as actual exclamation marks.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3851) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, 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

Unhiding or Listing All Objects

An Excel workbook can contain quite a few different objects. Sometimes those objects can be hidden so that they are not ...

Discover More

Specifying a Paper Tray in a Macro

If you are using a macro to create your printed Excel output, you may need a way to specify that paper should come from a ...

Discover More

Automatically Sorting as You Enter Information

When entering information into a worksheet, you may want it to always be in a correctly sorted order. Excel allows you to ...

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)

Adding an Ellipsis to the Beginning of Some Paragraphs

The Find and Replace feature of Word is very powerful. You can even use it to add a unique character to the beginning of ...

Discover More

Searching for Characters

When using pattern matching in a search, you can specify individual characters or ranges of characters you want matched ...

Discover More

Understanding Pattern Matching

Pattern matching is a type of searching you can do in Word that is very powerful. Despite its power, it remains rather ...

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 four less than 7?

2022-07-18 16:28:37

Therese Grisewood

Hi Allen,

I'm one of your subscribers from Ireland. I'm hoping you can help me.

I need to create a vocabulary list from each chapter of my proposed Spanish book. How do I create this? Is there a trick I need to know?

Thanks for all your tips each Saturday. I read them and save them. I also have some of your videos. I'm working through Macros and used them in my Spanish book.

Thanks again and stay safe in the sun. Imagine we have over 85 degrees Fahrenheit in Ireland today. Unheard of high temperatures for our little country.

Therese Grisewood
tquinn38@gmail.com


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.