Sub test()
Dim Tabl, Tabl2, Plage, Plage2, i&, j&
With Sheets("Feuil2")
Set Plage = .Range(.[A2], .Range("A" & Rows.Count).End(xlUp))
Set Plage2 = .Range(.[A1], .Range("A" & Rows.Count).End(xlUp))
.Range("E9:F" & Plage.Rows.Count).ClearContents
Tabl = .Range(.[A2], .Range("A" & Rows.Count).End(xlUp)).Value
Tabl2 = .Evaluate("TRANSPOSE(FREQUENCY(IF(" & Plage.Address & "<> """",MATCH(" & Plage.Address & "," & _
Plage.Address & ",0)),ROW(" & Plage2.Address & ")))")
j = 1
For i = 1 To Plage.Rows.Count
If Tabl2(i) > 4 Then
Dim Tabl3()
ReDim Preserve Tabl3(1 To Plage.Rows.Count, 1)
Tabl3(j, 0) = Tabl(i, 1)
Tabl3(j, 1) = Tabl2(i)
j = j + 1
End If
Next i
.Range("E9:F" & Plage.Rows.Count) = Tabl3
End With
End Sub
Sub test2()
Dim Tabl, Tabl2, Plage, Plage2, i&, j&, Nb
With Sheets("Feuil2")
Set Plage = .Range(.[A2], .Range("A" & Rows.Count).End(xlUp))
Set Plage2 = .Range(.[A1], .Range("A" & Rows.Count).End(xlUp))
.Range("C1:D" & Plage.Rows.Count).ClearContents
Tabl = .Range(.[A2], .Range("A" & Rows.Count).End(xlUp)).Value
Tabl2 = .Evaluate("TRANSPOSE(FREQUENCY(IF(" & Plage.Address & "<> """",MATCH(" & Plage.Address & "," & _
Plage.Address & ",0)),ROW(" & Plage2.Address & ")))")
Nb = .Evaluate("SUM(N(FREQUENCY(IF(" & Plage.Address & "<> """",MATCH(" & Plage.Address & "," & _
Plage.Address & ",0)),ROW(" & Plage2.Address & "))>4))")
j = 1
For i = 1 To Plage.Rows.Count
If Tabl2(i) > 4 Then
Dim Tabl3()
ReDim Preserve Tabl3(1 To Nb, 1)
Tabl3(j, 0) = Tabl(i, 1)
Tabl3(j, 1) = Tabl2(i)
j = j + 1
End If
Next i
.Range("C1:D" & Nb) = Tabl3
End With
End Sub