Forum Discussion

MForhood's avatar
MForhood
Copper Contributor
May 09, 2024

Help: Editing VBA code

Hi

 

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:

 https://drive.google.com/file/d/1-DX2e4VN8SQVHOl-OBkASNuh_Jfb1TU2/view?pli=1

 

  • Use a wildcard Find/Replace, where

    Find = (<*>)?\1

    and'=

    Replace = \1Note:

     

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

Resources