Option Compare Text 'la casse est ignorée
Private Sub Worksheet_Change(ByVal Target As Range)
Dim col As New Collection, decal&, tablo, resu(), i&, x$, n&
On Error Resume Next
With ListObjects(1).Range 'tableau structuré
decal = .Row - 1
tablo = .Resize(, 6)
ReDim resu(1 To UBound(tablo), 1 To 1)
For i = 2 To UBound(tablo)
x = tablo(i, 3) & tablo(i, 4) & tablo(i, 6)
If x <> "" Then
col.Add i + decal, x 'mémorise la ligne
n = col(x): resu(n, 1) = resu(n, 1) + 1 'comptage
resu(i, 1) = resu(n, 1)
End If
Next i
For i = 2 To UBound(resu)
x = tablo(i, 3) & tablo(i, 4) & tablo(i, 6)
If resu(i, 1) > 1 Then resu(i, 1) = col(x) Else resu(i, 1) = Empty
Next i
resu(1, 1) = .Cells(1, 8)
Application.EnableEvents = False 'désactive les évènements
.Columns(8) = resu 'restitution
Application.EnableEvents = True 'réactive les évènements
End With
End Sub