finding duplicate cell and deleting both
Sort the data and then run this macro:
Sub CheckForDupes()
Dim RowNdx As Long
Dim ColNum As Integer
ColNum = Selection(1).Column 'set number to match the proper column
For RowNdx = Selection(Selection.Cells.Count).Row To _
Selection(1).Row + 1 Step -1
If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Value Then
Cells(RowNdx, ColNum).Delete shift:=xlUp
End If
Next RowNdx
End Sub
Warning!! Use this macro on a sample of your data; test it on a small
sample. If it doesn't do what you want post back. It is extremely
frustrating to accidentally delete data that you didn't really want to delete.
Hope that helps,
Ryan---
--
RyGuy
"Pat Jones" wrote:
Hi;
I have about 8000 cells of which 800 are duplicates. I want to find all the
dupes and delete BOTH copies of them. Can that be done and if so, how ?
Thanks;
Pat
|