Friday, January 11, 2013

Highlight duplicate data in your worksheet.

There are times you need to highlight duplicate data in your worksheet.

Sub DupsRecord()


Application.ScreenUpdating = False

Rng = Selection.Rows.Count

For i = Rng To 1 Step -1

myCheck = ActiveCell

ActiveCell.Offset(1, 0).Select

For j = 1 To i

If ActiveCell = myCheck Then

Selection.Font.Bold = True

Selection.Font.ColorIndex = 3

End If

ActiveCell.Offset(1, 0).Select

Next j

ActiveCell.Offset(-i, 0).Select

Next i

Application.ScreenUpdating = True

End Sub



No comments: