Sub compterOccurrences()
Set liste = CreateObject("scripting.dictionary")
With Sheets("erreur")
colNom = Application.Match("Nom", .[4:4], 0)
For lig = 5 To .Cells(.Rows.Count, colNom).End(xlUp).Row
liste(.Cells(lig, colNom).Value & "#" & .Cells(lig, colNom + 1).Value) = liste(.Cells(lig, colNom).Value & "#" & .Cells(lig, colNom + 1).Value) + 1
Next lig
.[J1].Resize(liste.Count, 1) = Application.Transpose(liste.items)
End With
With Sheets("annuaire")
For lig = 5 To .[B50000].End(xlUp).Row
.Cells(lig, 4) = liste(.Cells(lig, 2) & "#" & .Cells(lig, 3))
Next lig
End With
End Sub