Dim Tableau()
Dim PtTabl As Integer
Dim w(12) As String
Sub Nom_FIP_3()
Dim Idx As Byte, V As Integer, x As Integer
y = Array(24, 41, 59)
z = Array(9, 25, 42)
With Sheets("Mois en cours")
For Idx = 0 To 2
V = -1: ReDim Tableau(20) 'si suffisant
For i = z(Idx) To y(Idx)
If Cells(i, 3) = 1 And Cells(i, 3).Interior.ColorIndex <> 3 Then
V = V + 1
Tableau(V) = Cells(i, 2)
'Debug.Print Tableau(V)
End If
Next i
Reco:
If V > 3 Then
V = V - 1
For i = Int(V * Rnd) To V
Tableau(i) = Tableau(i + 1)
'Debug.Print Tableau(i)
Next i
GoTo Reco
End If
For i = 0 To 3
w(PtTabl) = Tableau(i)
'Debug.Print w(PtTabl)
PtTabl = PtTabl + 1
Next i
Next Idx
End With
For i = 0 To 11 'les 12 noms tirer au hazard.
Debug.Print w(i)
Next i
End Sub