Sub BefFrm()
Dim i%, j%, k%, m&, n&, p&, coul(1 To 9), t, aux, deb
deb = Timer
Application.ScreenUpdating = False
For i = 1 To 9: coul(i) = i: Next
Randomize
With Worksheets("Grilles").Range("A1:I9002")
.ClearContents
.Interior.ColorIndex = xlNone
t = Range("A1:i9002")
For i = 1 To 9002
For p = 1 To 2: For m = 1 To 9: n = 1 + Int(9 * Rnd): aux = coul(m): coul(m) = coul(n): coul(n) = aux: Next m, p
For p = 1 To 4: t(i, coul(p)) = 1: Next p
Next i
.Range("a1").Resize(UBound(t), UBound(t, 2)) = t
.Range("A1:i9002").SpecialCells(xlCellTypeConstants).Interior.ColorIndex = 4
.Range("A1:i9002").ClearContents
End With
MsgBox Format(Timer - deb, "\ 0.0 sec.")
End Sub