Written by Allen Wyatt (last updated July 31, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Daniel has a long document that has many instances of bolded words interspersed with non-bolded words. He would like a way to delete all instances of regular text that appears between bolded text. Thus, "bold text with lots of regular text in the middle then more bold text" would be changed to "bold text more bold text." Daniel wonders if this be done with Find and Replace or if it requires a macro.
This can be done with Find and Replace, but you may want to think through if you really want to do it. As asked, it appears that Daniel wants to, effectively, delete all regular (non-bolded) text in the document. For instance, consider the situation where you have (1) bold text, followed by (2) non-bold text, followed by (3) bold text, followed by (4) non-bold text, followed by (5) bold text. You have, in this case, three instances of bold text (1, 3, and 5) separated by two instances of non-bold text (2 and 4). How does this get handled? As written, in Daniel's scenario, the two instances of non-bold text should be removed because they are bounded by bold text. Thus, all of the non-bold text is removed.
Here is how you would handle this in Find and Replace:
There are two gotchas you need to be aware of in doing this, and those gotchas are the reason I said you may want to "think through" if you really want to follow this route. First, since Find and Replace removes all non-bold text in the document, any non-bold text at the very beginning or very end of the document will be removed, even though they are not bounded on both sides by bold text. Second, you may end up with bold text not separated by spaces. This would occur if there were no bold-formatted spaces between two occurrences of bold text.
It is also important to realize that this approach is not discerning when it comes to what is between bolded text. It is very possible that your hard returns at the ends of paragraphs will be deleted, unless they are formatted as bold. This can result in some funky looking text when all is said and done.
If you want something a bit more discerning, then the most prudent approach would be to create a macro that can perform a more detailed analysis of the document and remove only what you actually want removed. Developing such a macro would be dependent on coming up with rules that you want applied to the entire document and then codifying those rules in the macro itself.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13889) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.
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!
Want to change the order of the day and month in a date? This tip shows you how you can do so using the Find and Replace ...
Discover MoreThe Find and Replace capabilities of Word are very powerful, allowing you to accomplish more than one task at a time. ...
Discover MoreSarra is having a problem getting Find and Replace to behave properly when replacing italic-formatted text. This tip ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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