Function DoublonNBrListe(xrg As Range, Optional opt)
Dim dic As New Dictionary, x, n&, s
Set dic = CreateObject("scripting.dictionary"): dic.CompareMode = TextCompare
For Each x In xrg: dic(CStr(x)) = dic(CStr(x)) + 1: Next
If IsMissing(opt) Then
For Each x In dic
If dic(x) > 1 Then n = n + dic(x) - 1
Next x
DoublonNBrListe = n
Else
For Each x In dic
If dic(x) > 1 Then s = s & "," & x
Next x
DoublonNBrListe = Mid(s, Len(",") + 1)
End If
End Function