Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Quicker Multiple Replace Operations.
It is not unusual to use the Replace function multiple times to replace the same information. For instance, you may have a document that contains quite a few tabs. You can use the Replace function to replace two tabs with a single tab. In this way, you can get rid of the extra tabs. However, if your document contains many, many extra tabs, you can replace 8, 20, or 50 tabs with a single tab.
When you are specifying the number of tabs to replace, it is best to use a multiple of two. For instance, in the Find What box you would enter 4, 8, 16, or 32 tabs, and in the Replace With box you would enter a single tab. Continue selecting the Replace All button until you are informed the requested characters could not be found.
Next, divide the number of characters in the Find What box by two. Thus, if you previously searched for 16 tabs, you would now search for 8. You will only have to click on the Replace All button once then. (Word could not find two groups of 8 in a row—if it did, it would have been replaced by the previous search for 16.) On the next iteration, use only 4, and finally 2 tabs. Basically, you have replaced all the extra tabs in around 4 or 5 operations. This is the fastest possible way to do the iterative search and replace.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (8800) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Quicker Multiple Replace Operations.
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!
Need to get down to the "character level" when searching for information in a document? Word allows you to search for any ...
Discover MoreWord allows you to insert different types of breaks in your text that help control how your document is paginated. If you ...
Discover MoreWhen writing in non-English languages, there can be many variations of accented characters that are used in a word. You ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-03-09 05:22:31
Kiwerry
Some commenters have not read previous comments. I can recommend Ken's first comment, right at the bottom of the following thread.
2017-10-03 06:10:17
V.S.Rawat
long winded process
in find replace window
1. tick mark "use wild card"
2. put A{2, } in find box
3. put A in replace box
click replace.
it will replace all two or more numbers of AA, AAA, AAA with a single A in one go
You can change A with any letter or digit or puncuation or control character you wish to replace.
and it should work alike in old and new word.
2015-06-02 19:53:00
remus
Ok,
I can't figure this out:
I have 400 pages of this type of text:
ART. X.XXX
Title of Article
Content Content Content Content...
Where X.XXX is a number such as "1.169".
I would like to make it into:
bold: (ART. X.XXX Title of Article )
Content Content Content etc
so far, I've managed to use wild cards etc to either change all ART. ?.??? into bold, or to replace all ^p^p with ^p...which did little to what I want to achieve.
I would need something that finds each and every ART. X.XXX ^P + all text on the following line
and replaces is with ART. X.XXX + The text on the following line, only on the same line as ART. and in bold.
any clues ?
2014-11-25 22:34:40
I find this tip works. However the "," needs to be replaced by whatever you use as the separation character ";" in my case.
Also better to use "Number of occurrences" from the special list.
Has anyone a macro (as I am new at this) that replaces all double tabs, double spaces, paragraph and then spaces with singles.
Then it places all .?! with double space following it.
I often need it to clean up documents typed by others.
2014-06-03 07:06:58
Bryan
"Let's say that we don't know of Ken's superior method... "
2014-06-03 03:55:16
Ken Endacott
If you want to get some idea of how powerful wildcards can be, have a look at the examples in the document file FindReplaceData.docx that is in the package that can be downloaded from www.editordie.com.au/editorkae
The document also contains a primer in the appendix on how to use wildcards.
2014-06-03 03:42:49
Ken Endacott
Bryan
With the wildcards that I have given, you only need to click Replace All once. It will find any number of consecutive tabs and replace them by a single tab. The wild cards {2,} mean find two or more consecutive occurrences. If it were {1,} then it would find one or more which would still work as it would replace a single tab with a single tab.
As you can see it it very much faster than Allen's.
2014-06-02 08:02:39
Bryan
(Sorry about the last comment, I keep getting blocked and unblocked and I didn't want to type out my comment only to have it eaten)
Let's say that we don't know of Ken's superior method... it seems to me that replacing repeated groups of 2 tabs would be better than picking some high number of tabs and reducing it. This method has many benefits over Allen's:
* You can just keep pressing "Replace All" until you have 0 replacements.
* You don't have to worry that you didn't pick a high enough number of tabs to start.
* You don't have to change the number of tabs in between each run.
* While you may, depending on the exact distribution of tabs, have to do more replacements with the "low number" method, you won't have any "wasted" replacements. In Allen's example above starting at 16, if you only had, say, one doubled tab, the 16, 8, and 4 replacements would have no effect.
2014-05-31 16:48:06
Ken Endacott
Pam
Yes, you can use ^t instead of ^9 Also, if you are replacing spaces you can use an actual space character, but ^32 is more visible.
LMcIntyre
It looks like you haven't ticked Use wildcards in the drop down menu under the More button. Alternatively there might be a space character in the Find box that can happen when you cut and paste and there is a space on the beginning or end of the string that you are pasting.
2014-05-31 11:14:39
LMcIntyre
Ken's suggestion doesn't seem to work. I get the report that 0 replacements have been made. I cut and pasted his Find box contents, tried it without the brackets, without the comma, using ^t instead of ^9 ... and I always get the report that Word has finished and 0 replacements have been made. My document (which I created with several successive tabs) is unchanged.
2014-05-31 11:07:55
LMcIntyre
Ken's suggestion doesn't seem to work. I get the report that 0 replacements have been made. I cut and pasted his Find box contents, tried it without the brackets, without the comma, using ^t instead of ^9 ... and I always get the report that Word has finished and 0 replacements have been made. My document (which I created with several successive tabs) is unchanged.
2014-05-31 09:45:57
Pam Caswell
Conveniently, ^t, the regular search code for a tab works in wildcard searches--so we don't have to remember ^9.
But ^p, the regular search code for a paragraph mark, still does not. For that, we have to use ^013.
2014-05-31 04:43:50
Ken Endacott
There is a much quicker way to replace multiple tabs with a single tab by using wildcards. In the Find box enter:
[^9]{2,}
In the Replace box put:
^9
Make sure that Use wildcards is ticked (click More >> if you can't see it).
Click Replace All.
Explanation: ^9 is the ASCII code for the Tab character. {2,} means for two or more occurrences of the preceding character.
You can use the same technique to replace multiple spaces with a single space. Instead of ^9 put ^32
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