Sub tirage()
'adapation d'un code original de Lii
Dim d, i&, j&, f$
f = "=COUNTA(R[-17]C:R[-2]C)-SUMPRODUCT(IF(R[-17]C:R[-2]C<>"""",1/COUNTIF(R[-17]C:R[-2]C,R[-17]C:R[-2]C)))"
Set d = CreateObject("Scripting.Dictionary")
Application.ScreenUpdating = False
[E15:E20].Interior.ColorIndex = xlNone
Randomize 127854
Do
n = Int(42 * Rnd + 1)
If Not d.Exists(n) Then d.Add n, n
Loop Until d.Count = 42
a = d.keys
For i = 0 To 5
Cells(i + 15, 5) = a(i)
Next i
'ajout marquage/comptage doublons
coldup [E5:E20]
With [E22]
.FormulaArray = f
.Value = .Value
End With
End Sub