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

Making a Cell's Contents Bold within a Macro

When your macro is processing information in a worksheet, do you need to periodically make the contents of a cell bold? ...

Discover More

Improper Index References

When indexing a document, you may get some funny results once in a while. If you get single index entries when you were ...

Discover More

Returning Blanks with VLOOKUP

Normally the VLOOKUP function returns a value, and if it can't return a value it returns a zero. Here's how you can use ...

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)

Ordering Search and Replace

The wildcard searching available in Word is very powerful. Here's how you can use ordering in your search efforts to make ...

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

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
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 6 - 0?

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.