Help: Editing VBA code

Copper Contributor



I have a code that highlight duplicated words or numbers, it gives the first value a pink color, and the duplicate a green color.


AFAIK Words can't search for a specific highlight color. So what I want it to do so I can delete the duplicate values is to add underline to the duplicate instead of highlight.



This is the code:


1 Reply

Use a wildcard Find/Replace, where

Find = (<*>)?\1


Replace = \1Note:


This assumes there is always a single character separating the repeated words and that they're of the same case.