How to use VBA to highlight duplicate values in an Excel spreadsheet

When a conditional formatting rule is overkill, use these VBA procedures to highlight duplicates and then remove the highlighting in Microsoft Excel.

Image: Rawpixel.com/Shutterstock

There are many ways to find duplicates in a Microsoft Excel data range—conditional formatting being one of the most commonly used. When the rule is TRUE, the format stays until the condition is FALSE or you remove the rule. However, sometimes, you only want a quick look or count of duplicates; you don’t want a permanent format. Or, more reasonably, users might not be savvy enough to apply a conditional formatting rule. In either case, this article will review VBA code that highlights duplicates in a data range. This article also includes code to remove highlighting from a data range.

SEE: 83 Excel tips every user should…

Keep reading the full content on the TechRepublic site.


Get Free Email Updates!

Signup now and receive an email once I publish new content.

I agree to have my personal information transfered to ConvertKit ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Spread the love

Leave a Comment