Sub NbrTemoin()
Dim t, derlig&, i&, d
With Sheets("Feuil1")
If .FilterMode Then .ShowAllData
derlig = .Cells(.Rows.Count, "f").End(xlUp).Row
t = .Range("f2:i" & derlig)
End With
ReDim Preserve t(1 To UBound(t), 1 To UBound(t, 2) + 1)
Set d = CreateObject("scripting.dictionary")
d.CompareMode = TextCompare
For i = 1 To UBound(t): d(t(i, 1)) = d(t(i, 1)) + 1: Next
For i = 1 To UBound(t)
If d(t(i, 1)) = 1 Then
t(i, UBound(t, 2)) = "témoin seul"
ElseIf d(t(i, 1)) > 2 Then
t(i, UBound(t, 2)) = "nb temoins >2"
End If
Next i
With Sheets("Feuil2")
derlig = .Cells(16, "a").End(xlDown).Row
.Range("a16:e" & derlig).ClearContents
.Range("a16").Resize(UBound(t), UBound(t, 2)) = t
.Activate
End With
End Sub