There is a Delete Duplicates function in Excel that makes it very easy to delete any duplicate data in your spreadsheet. However, sometimes you may not want to delete that data, you just want to know that there are duplicates. One way of doing this is with a simple macro. To highlight and draw attention to duplicates in a Microsoft Excel spreadsheet with a bold red color create this macro (alt+F11 opens the macro editor):
Sub DupsinRed()
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
The statement "Application.ScreenUpdating = False" prevents the screen from updating to ensure the macro runs faster and the screen will not flicker. Don't forget to set it back to "True".
Sorry...didn't work for me.
ReplyDeleteWhy not? Are you getting an error message?
ReplyDeleteno you don't have to use macro. first block the cells where you want to find out the duplicate values. and then from column Styles in "Home", you select Conditional Formatting, then choose Highlight Cells Rules --> Duplicate values. there you go :)
ReplyDeleteThe problem with this is that it will only highlight the duplicate cells, not the entire row
DeleteYay! thank you!
DeleteThis is great! Thanks!!!
DeleteThis is exactly what I was needing to do. And when I was done I just did a control Z to remove the highlights. Thanks so much Vira Av for this easy alternate method.
DeleteWhat a great tip!
DeleteNo problem! Glad I could help. Sign up for our email newsletter for more tips.
ReplyDeleteIs there a way to undo the Conditional formatting when you are done?
ReplyDeleteThis is really very nice information you share here. Delete duplicate function is really good to used for all excel users to highlight all duplicate data in excel spreadsheet without delete them. This function works really good and makes easy way to delete all duplicate data in excel spreadsheet.
ReplyDeleteexcel trainingin melbourne