Temjeh
XLDnaute Accro
Bonjour et merci d'avance
Hey oui après 2 hrs d'essai je met mon orgueil de coté et solicite votre aide pour faire ma boucle:
Ceci est bon:
Il me semble que ceci devrait fonctionné mais ca ne fait pas ce que j'aimerais:test sur colonne et si trouve met cell en rouge (ici colonne de test est la même mais les cell à mettre en rouge sont 3 par ligne et en dessous l'un de l'autre:
Ptêtre il me manque la solution pour le faire sortir de la boucle après 3 fois
[For b = 6 To 12
For i = 6 To 26
a = 1
z = 5
If Cells(i, 12) = "Exclu" Then Cells(b, z).Font.ColorIndex = 3
z = z + 2
a = a + 1
If a = 3 Then Exit For
If z > 9 Then Exit For
Next i
Next ba = 1
For b = 6 To 12
z = 5
For i = 6 To 26
If Cells(i, 12) = "Exclu" Then Cells(b, z).Font.ColorIndex = 3
z = z + 2
a = a + 1
If a = 3 Then Exit For
If z > 9 Then Exit For
Next i
Next b
[/Code]
Merci
A++
Ce lien n'existe plus
Hey oui après 2 hrs d'essai je met mon orgueil de coté et solicite votre aide pour faire ma boucle:
Ceci est bon:
Code:
z = 5
For i = 6 To 8
If Cells(i, 12) = "Exclu" Then Cells(6, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 9 To 11
If Cells(i, 12) = "Exclu" Then Cells(7, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 12 To 14
If Cells(i, 12) = "Exclu" Then Cells(8, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 15 To 17
If Cells(i, 12) = "Exclu" Then Cells(9, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 18 To 20
If Cells(i, 12) = "Exclu" Then Cells(10, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 21 To 23
If Cells(i, 12) = "Exclu" Then Cells(11, z).Font.ColorIndex = 3
z = z + 2
Next i
z = 5
For i = 24 To 26
If Cells(i, 12) = "Exclu" Then Cells(12, z).Font.ColorIndex = 3
z = z + 2
Next i
Il me semble que ceci devrait fonctionné mais ca ne fait pas ce que j'aimerais:test sur colonne et si trouve met cell en rouge (ici colonne de test est la même mais les cell à mettre en rouge sont 3 par ligne et en dessous l'un de l'autre:
Ptêtre il me manque la solution pour le faire sortir de la boucle après 3 fois
[For b = 6 To 12
For i = 6 To 26
a = 1
z = 5
If Cells(i, 12) = "Exclu" Then Cells(b, z).Font.ColorIndex = 3
z = z + 2
a = a + 1
If a = 3 Then Exit For
If z > 9 Then Exit For
Next i
Next ba = 1
For b = 6 To 12
z = 5
For i = 6 To 26
If Cells(i, 12) = "Exclu" Then Cells(b, z).Font.ColorIndex = 3
z = z + 2
a = a + 1
If a = 3 Then Exit For
If z > 9 Then Exit For
Next i
Next b
[/Code]
Merci
A++
Ce lien n'existe plus
Dernière édition: