View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Find Duplicates Variant

Public Sub ProcessData()
Dim iLastRow As Long
Dim i As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Application.CountIf(Range("A1:A" & iLastRow), .Cells(i,
"A").Value) < 3 Then
.Rows(i).Delete
End If
Next i

End With

End Sub


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Ladymuck" wrote in message
...
Contrary to most people, I want to keep the duplicates in my spreadsheet!
What I need to do is basically keep anything that occurs 3 or more times.

I
have had a go at amending the code posted up so far but am not having a

huge
amount of luck - would anyone be kind enough to help?

Many thanks!