Written by Allen Wyatt (last updated August 12, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021
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:
{ SEQ John \# "'John'000\:" }
Figure 1. Getting ready to do a replacement.
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, 2016, 2019, Word in Microsoft 365, and 2021.
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!
In plain-text documents, it is not uncommon to see asterisks used around text to indicate what should be considered bold ...
Discover MoreWhen you use the Find and Replace tool in Word, you may want to include what you searched for in the replacement text. ...
Discover MoreIf you get a document or some text that has multiple consecutive spaces used to align information, you'll undoubtedly be ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-08-12 10:38:36
Brian Lair
Great tip! I didn’t know about the ability to have multiple, independent SEQuences. Plus, your added “ you can, if desired, take the extra step…” is a good example of why I like these tips columns in general: You don’t just answer the questions; you put yourself in the users’ shoes and address “what other questions might arise from this one?” Thanks, Allen.
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