Bonjour angles,
voici un petit complément ; au départ, il y a cette image initiale : image 1 ;
puis chaque fois que tu feras Ctrl e, il y aura en image un résultat de ce
genre : image 2.
code VBA de Module1 (18 lignes) :
Option Explicit
Sub CoulAlea()
Dim L1, L2: Randomize: Application.ScreenUpdating = 0
L1 = Array(255, 16711680, 32768, 13158, 6684774, 0)
L2 = Array(16777215, 65535, 16772300, 14348258, 16247773, 11389944)
Dim n As Byte, p As Byte, b As Byte, ct&, cf&, c&, i As Byte, j As Byte
n = UBound(L1) + 1: p = UBound(L2) + 1
For i = 1 To 25
For j = 1 To 25
b = Int(Rnd * 2) + 1: cf = IIf(b = 1, L1(Int(Rnd * n)), L2(Int(Rnd * p)))
Do
ct = IIf(b = 1, L2(Int(Rnd * n)), L1(Int(Rnd * p)))
Loop Until ct <> cf
With Cells(i, j): .Interior.Color = cf: .Font.Color = ct: End With
Next j
Next i
End Sub
rhodo