27 | 06 | 2017

Highlight Column Duplicates

Code below searches for duplicates in row A and highlights them when double.  

Sub MakeDuplicatesRed()
 
'****************************************
'*** Code from VisibleVisual.com ********
'****************************************
 
Application.ScreenUpdating = False
 
Rng = Selection.Rows.Count
 
For i = Rng To 1 Step -1
 
CheckCell = ActiveCell
 
ActiveCell.Offset(1, 0).Select
 
For j = 1 To i
 
    If ActiveCell = CheckCell Then
    Selection.Font.Bold = True    'Make Duplicate Red
    Selection.Font.ColorIndex = 3 '3 is color Red
    End If
    ActiveCell.Offset(1, 0).Select
    Next j
    ActiveCell.Offset(-i, 0).Select
 
Next i
 
 
Application.ScreenUpdating = True
 
End Sub
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2288494
Latest Articles