Deleting Dups
Posted by Tricia on January 21, 2002 8:38 AM
I have the following macro to delete duplicates. I sort first, of course. The problem is, I have to know the maximum # of times a one of the values in the elected area is duplicated to know how many times to loop it. Is there a better way? Thanks :-)
Sub DeleteDups()
Application.ScreenUpdating = False
For uY = 1 To 6 'Spin through 6 times
For Each Cell In Selection
If Cell.Value = Cell.Offset(1, 0).Value Then
Cell.EntireRow.DELETE (xlShiftUp)
End If
Next Cell
Next
End Sub