le forum bonjour,
c'est la macro sur base de 20 personnes sur 20 jours (merci h2s04)
je voudrais l'adapter sur base de 16 personnes et 16 jours ....quel paramètre modifier ? ca me permettrait d'essayer de l'adapter par la suite
merci
tomatito37
Sub tirage()
For i = 1 To 20
Cells(4, i + 5) = Cells(i + 3, 1)
Next i
For i = 2 To 20
For j = 1 To 20
If j = 20 Then
Cells(i + 3, j + 5) = Cells(i + 2, 6)
Else
Cells(i + 3, j + 5) = Cells(i + 2, j + 6)
End If
Next j
Next i
'melange colonne
For i = 1 To 20
d = Application.RandBetween(6, 25)
Range(Cells(4, d), Cells(23, d)).Cut
c = d
While c = d
c = Application.RandBetween(6, 25)
Wend
Range(Cells(4, c), Cells(23, c)).Insert shift:=xlToRight
d = Application.RandBetween(4, 23)
Range(Cells(d, 6), Cells(d, 25)).Cut
c = d
While c = d
c = Application.RandBetween(4, 23)
Wend
Range(Cells(c, 6), Cells(c, 25)).Insert shift:=xlDown
Next i
For c = 6 To 25
Range(Cells(4, c), Cells(23, c)).Interior.Color = Cells(3, c).Interior.Color
Next c
End Sub