Sub Tirages()
Dim dur, ntirage&, d As Object, n&, t1(), t2(), i&, a, j%, maxi&, mem1, mem2
dur = Timer
ntirage = 1000 'nombre de tirages, modifiable
Set d = CreateObject("Scripting.Dictionary")
Randomize
Application.ScreenUpdating = False
For n = 1 To ntirage
'---tableau t1---
ReDim t1(1 To 4)
d.RemoveAll
t1(1) = Int(1 + 5 * Rnd): d(t1(1)) = ""
1 t1(2) = Int(1 + 8 * Rnd)
If d.exists(t1(2)) Then GoTo 1 Else d(t1(2)) = ""
2 t1(3) = Int(1 + 10 * Rnd)
If d.exists(t1(3)) Then GoTo 2 Else d(t1(3)) = ""
3 t1(4) = Int(5 + 11 * Rnd)
If d.exists(t1(4)) Then GoTo 3
'---tableau t2---
ReDim t2(1 To 25, 1 To 10)
For i = 1 To 25
d.RemoveAll
While d.Count < 10: d(Int(1 + 70 * Rnd)) = "": Wend
a = d.keys
For j = 1 To 10
t2(i, j) = a(j - 1)
Next j, i
'---restitution---
[Q4].Resize(, 4) = t1
[G6].Resize(25, 10) = t2
If [F5] > maxi Then maxi = [F5]: mem1 = t1: mem2 = t2
Next n
[Q4].Resize(, 4) = mem1
[G6].Resize(25, 10) = mem2
Application.ScreenUpdating = True
MsgBox "Durée " & Format(Timer - dur, "0.00 \s")
End Sub