mani_singh
Well-known Member
- Joined
- Jul 24, 2007
- Messages
- 583
i need to rank duplicates in most reoccuring format
any ideas?
any ideas?
Sub PickMyEntries()
Dim Limit As Long
Dim c As Long
Dim d As Long
Limit = Cells(Rows.Count, 1).End(xlUp).Row
d = 2
For c = 2 To Limit
If WorksheetFunction.CountIf(Range("C:C"), Cells(c, 1)) = 0 Then
Cells(d, 3) = Cells(c, 1)
d = d + 1
End If
Next c
End Sub
Sub rankdupes()
nd = [a65536].End(xlUp).Row
a = [a1].Resize(nd, 1)
With CreateObject("Scripting.Dictionary")
For i = 2 To nd
If Not IsEmpty(a(i, 1)) And Not .exists(a(i, 1)) Then
.Add a(i, 1), 1
Else: .Item(a(i, 1)) = .Item(a(i, 1)) + 1
End If
Next i
[c2].Resize(.Count, 2) = Application.Transpose(Array(.keys, .Items))
[c2].Resize(.Count, 2).Sort Key1:=[d2], Order1:=xlDescending
End With
End Sub