Try this:-
Results start "C1"
Sub MG18Jun39
Dim Rng As Range
Dim Dn As Range
Dim n As Long
Dim Q
Dim Col As Integer
n = 1
Set Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
ReDim ray(1 To Rng.Count + 1, 1 To 3)
ray(1, 1) = "I/D": ray(1, 2) = "New": ray(1, 3) = "Old"
With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
For Each Dn In Rng
Col = IIf(Dn.Offset(, 1) = "New", 2, 3)
If Not .Exists(Dn.Value) Then
n = n + 1
ray(n, 1) = Dn
ray(n, Col) = 1
.Add Dn.Value, Array(ray, n)
Else
Q = .Item(Dn.Value)
ray(Q(1), Col) = ray(Q(1), Col) + 1
.Item(Dn.Value) = Q
End If
Next
Range("C1").Resize(.Count + 1, 3) = ray
End With
End Sub
Regards Mick
Bookmarks