Quantcast
Channel: Automate Excel » dynamic ranges
Viewing all articles
Browse latest Browse all 3

VBA: Highlight Duplicates in a Range

$
0
0
The following subroutine will highlight all the duplicate values in range in yellow. It does not matter whether the values are text or numbers. It uses Excel’s COUNTIF function to count up the duplicates and then sets the colour to yellow: Sub Highlight_Duplicates(Values As Range) Dim Cell For Each Cell In Values If WorksheetFunction.CountIf(Values, Cell.Value) [...]

Viewing all articles
Browse latest Browse all 3

Trending Articles