Formatting Issues

How to Remove or Replace a Specific Highlight Color in Word

Khadija KhanKhadija Khan Oct 23, 2026 869 views

Question details

The user wants to remove or replace one specific highlight color in a Microsoft Word document without altering text highlighted in different colors.

How to Remove or Replace a Specific Highlight Color in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
Trying to selectively clear or change a particular highlight color (e.g., yellow) while leaving other highlight colors (e.g., green or blue) intact.
Observed behavior
Word's standard Find and Replace tool only searches for generic highlights and cannot differentiate between specific highlight colors.
Before you start

Ensure your document is saved and that you have the Developer tab enabled in Word, as you will need to access the VBA editor to run the required macro.

Solution 1Recommended

Use a VBA Macro to Target and Remove a Specific Highlight Color

Since Word's built-in interface cannot isolate a specific highlight color, running a short VBA macro is the most effective way to selectively clear it.

This macro reads the highlight color of the text currently selected by your cursor, searches the entire document for that exact color, and removes the highlight automatically.

1
Select the target highlight color

Place your text cursor directly on a word that has the specific highlight color you wish to remove from the document.

2
Open the VBA Editor

Press the Alt + F11 keys on your keyboard to open the Microsoft Visual Basic for Applications window.

3
Insert a new module

Click on 'Insert' in the top menu bar, and select 'Module' from the dropdown list to open a blank code window.

4
Paste the macro code

Copy and paste the following code into the module window: Sub RemoveOneHighlight() Dim HLColor As WdColorIndex Dim rg As Range HLColor = Selection.Range.HighlightColorIndex If HLColor <> wdNoHighlight Then Set rg = ActiveDocument.Range With rg.Find .Highlight = HLColor .Wrap = wdFindStop While .Execute If rg.HighlightColorIndex = HLColor Then rg.HighlightColorIndex = wdNoHighlight rg.Collapse wdCollapseEnd Wend End With Else MsgBox "Place the cursor on text that has the highlight to remove." End If End Sub

5
Run the macro

Press F5 or click the green 'Run' button in the toolbar. The macro will execute, and the specific highlight color will be removed throughout the entire document.

Use a VBA Macro to Target and Remove a Specific Highlight Color
Replacing Instead of Removing Colors: To replace one highlight color with another instead of just removing it, a more complex macro with a user form is required to select both the original and new colors. For simple removals, the script above is sufficient.
Free Microsoft Office alternative

Edit and Format Documents Easily with WPS Office

WPS Office offers a comprehensive, highly compatible, and free alternative to Microsoft Word. It provides advanced formatting tools, a familiar interface, and seamless support for your existing documents without the heavy subscription costs.

  1. 1. Download the software: Visit the official WPS website to download the free WPS Office suite for your operating system.
  2. 2. Install and launch: Follow the simple installation instructions and open the WPS Writer application.
  3. 3. Open your Word documents: Open your existing DOCX files directly in WPS Writer to continue editing and formatting without losing any data.
Fully compatible with Microsoft Word DOC and DOCX formats.Rich text formatting and highlighting tools to easily manage document revisions.Lightweight design for fast loading and smooth editing.Free to download and use with a highly familiar user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use the standard Find and Replace tool to remove a specific highlight color?

No, Microsoft Word's standard Find and Replace tool can only detect if text is highlighted or not. It cannot differentiate between specific highlight colors like yellow or green, which is why a VBA macro is required.

Will running this VBA macro affect other document formatting?

No, the provided macro specifically targets the HighlightColorIndex property. All other text formatting, including bold, italics, font size, or font color, will remain completely unaffected.

How do I save a document after running a macro in Word?

If you want to keep the macro for future use, you must save your document as a Word Macro-Enabled Document (*.docm). If you only needed to run it once and want to discard the code, simply save it as a standard Word Document (*.docx) and Word will automatically strip out the macro.