Replacing and Renumbering

by Allen Wyatt
(last updated September 13, 2019)

7

Don has a need to both replace and renumber at the same time. For instance, he has a transcript that contains dialogue. Each statement by "John" starts with his name followed by "XX:", so it looks like this: "JohnXX:". Don would like to replace the first instance of "JohnXX:" with "John001:", the second with "John002:", the third with "John003:", and so on. He wonders if there is a way to do this with Find and Replace.

Perhaps the easiest way to do this is to set up a SEQ field that can do the counting for you. Follow these steps:

  1. Someplace in your document, press Ctrl+F9 to create a set of empty field braces.
  2. Make sure the insertion point is between the field braces.
  3. Type the following between the braces: SEQ John \# "'John'000\:" This is how the field should look:
  4.      { SEQ John \# "'John'000\:" }
    
  5. Press F9 to collapse the field. Word should replace the field with "John001:" (without the quote marks).
  6. Select the field and press Ctrl+X. This removes the field from your document and saves it in the Clipboard.
  7. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  8. In the Find What box, enter what you are search for (JohnXX:).
  9. Click the More button, if it is available.
  10. Make sure the Match Case check box is selected.
  11. In the Replace With box, enter ^c. This informs Word you want to replace whatever is found with the contents of the Clipboard. (See Figure 1.)
  12. Figure 1. Getting ready to do a replacement.

  13. Click Replace All.

When you do this, what you should notice is that your document now has all the JohnXX: text replaced with John001: text. In order to see the right count, you need to update all the fields. The easiest way to do this is to press Ctrl+A (to select the entire document) and then press F9 (to update all the fields).

It helps to understand one thing about your field code, used in step 3. Note that right after the SEQ code there is the word "John." This is actually used as the name for the numbering sequence you are setting up. This could be any other word you want, if you prefer; it is up to you. It also means that you can set up other numbering sequences in your document, if you desire.

For instance, let's say that the transcript is actually a dialog between John and Fred. If all of John's statements start with "JohnXX:", then the above steps would only affect John's statements. Assuming that Fred's statements similarly start with "FredXX:", you could use the same series of steps, but all you would need to do is change the field code in step 3 to this:

{ SEQ Fred \# "'Fred'000\:" }

Further, you would need to change what you are searching for (in step 7) to the prefix used for Fred's transcript statements.

When you are done with all of your finding and replacing, you can, if desired, take the extra step of "unlinking" the fields, which simply means permanently replacing them with their computed value. To do this, simply press Ctrl+A (to again select the entire document) and then press Ctrl+Shift+F9 (to unlink all the fields). Note that you won't want to take this unlinking step if you may need to alter the order of the paragraphs at some future point.

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

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

Hiding Individual Cells

Hiding information in one or more cells can be a challenge. This tip presents several different techniques that can help ...

Discover More

Adjusting Spacing After a Paragraph

There is no need to press Enter a second time at the end of each paragraph. Let Word take care of the spacing ...

Discover More

Hyperlinks No Longer Work in a Workbook

Hyperlinks can be a great timesaver and very convenient. Unless, of course, if they don't work as you expect. This tip ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Keeping a Replace Operation Displayed

The Find and Replace tool is designed to help you find and replace information as quickly as possible. However, you may ...

Discover More

Replacing Formatting Functions as a Toggle

Sarra is having a problem getting Find and Replace to behave properly when replacing italic-formatted text. This tip ...

Discover More

Initiating a New Search

I do a lot of searching in my documents. Sometimes the searches may not go exactly as I expected. Here are some things I ...

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 three less than 9?

2021-07-09 02:54:01

Dr Murthy Remilla

1) thank you very much for teh excellent tutorial.I am a regular follower of your tips coming to my mail through subscription.


like the example of John, i have a docuemnt with (Q) occurring in 100 places. I wanted to repalce thwm with (Q1), (Q2) ..(Q100). after the "repalce all" I am getting Q001 at all the 100 places as expected. But even after Cntrl+A and F9, sequential numbers are not coming. please help

the script i have used is :

{ SEQ (Q) \# (Q'000)\ }

2) Also i want the numbering as Q1, Q2 onstead of Q001, Q002.

Please help

- Dr. Murthy Remilla, India


2021-07-09 01:39:06

Dr Murthy Remilla

1) thank you very much for teh excellent tutorial.I am a regular follower of your tips coming to my mail through subscription.


like the example of John, i have a docuemnt with (Q) occurring in 100 places. I wanted to repalce thwm with (Q1), (Q2) ..(Q100). after the "repalce all" I am getting Q001 at all the 100 places as expected. But even after Cntrl+A and F9, sequential numbers are not coming. please help

the script i have used is :

{ SEQ (Q) \# (Q'000)\ }

2) Also i want the numbering as Q1, Q2 onstead of Q001, Q002.

Please help

- Dr. Murthy Remilla, India


2016-01-25 01:48:41

Alisdair

Brilliant...many thanks!


2016-01-24 12:56:55

Margaret White

This formula does not work for me. Is it limited to certain versions of Word?


2016-01-23 10:59:27

Mary Lu Strange

Thank you for this site. I've already saved hours of frustration using your tips.


2016-01-23 10:18:36

art finkle

When making changes in a 200 page manuscript, the end notes are 'out of quilter.'

How do I enable the end notes to appear in perfect sequnece?


2016-01-23 08:21:09

John

Thanks for this; would be very helpful for interviews. I could easily go to the exact quote needed to confront a witness on cross examination.


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.

Newest Tips
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.