Written by Allen Wyatt (last updated August 30, 2025)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365
Will notes that in Excel he can create conditional formats to highlight information that meets defined criteria. He wonders if there is a way in Word to do essentially the same thing, applying paragraph-level formatting based on content contained within the paragraph.
There is no equivalent of conditional formatting within Word; that is strictly an Excel feature. You may, however, find a workaround satisfactory. Since Will mentions styles, I'm going to assume he knows how to create them and apply them. With that in mind, follow these steps:
What you end up with is every paragraph that contains the "trigger" text will now be formatted with the desired style. If you later remove the "trigger" text from a paragraph, Word won't change the paragraph formatting; you'll need to change it manually. If you later add the "trigger" text to a different paragraph, you'll need to again do the Find and Replace.
If you prefer to use a macro to do the styling, the following will process an entire document quickly:
Sub ConditionalStyles() Dim p As Paragraph Dim sTrigger As String Dim sStyleName As String sTrigger = "my trigger text" sTrigger = "*" & LCase(sTrigger) & "*" sStyleName = "MyStyle" For Each p in ActiveDocument.Paragraphs If LCase(p.Range.Text) Like sTrigger Then p.Style = sStyleName End If Next p End Sub
To use the macro, set sTrigger to the "trigger" text and set sStyleName to the name of the style to apply. The style name must be defined within the document. The same usage caveats apply here as I mentioned earlier with the Find and Replace process.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13951) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2019. Spend more time working and less time trying to figure it all out! Check out Word 2019 For Dummies today!
Word allows you to modify the language associated with the text in your document. How you modify the language can affect ...
Discover MoreUsing styles in your documents can be very helpful when it comes to consistency and ease of formatting. When others open ...
Discover MoreUsing the Styles and Formatting task pane, Word allows you to select all instances of a given style in your document. ...
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 © 2025 Sharon Parq Associates, Inc.
Comments