Try this for results starting "F1"
Sub MG10Dec27
Dim Rng As Range, Dn As Range, K As Variant, oMax1 As Date, G As Variant
Dim c As Long, oMax2 As Double
Set Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
For Each Dn In Rng
If Not .Exists(Dn.Value) Then
.Add Dn.Value, Dn
Else
Set .Item(Dn.Value) = Union(.Item(Dn.Value), Dn)
End If
Next
c = 1
Range("F1:H1").Value = Array("Client", "Pay_Date", "Amount")
For Each K In .keys
oMax1 = Application.Max(.Item(K).Offset(, 1))
For Each G In .Item(K).Offset(, 1)
If G = oMax1 Then
oMax2 = Application.Max(oMax2, G.Offset(, 1))
End If
Next G
c = c + 1
Cells(c, "F") = K
Cells(c, "G") = CDate(oMax1)
Cells(c, "H") = oMax2
oMax1 = 0: oMax2 = 0
Next K
End With
End Sub
Regards Mick
Bookmarks