Dim Cellule As Range '[COLOR=Green] Déclare la variable Cellule[/COLOR]
Sub Formeautomatique1_QuandClic()
For Each Cellule In Range("C3:C100")[COLOR=Green] 'Pour chaque cellule dans la plage[/COLOR] [COLOR=Green]C3 : C100[/COLOR]
If Cellule.Value = "x" [B]And Cellule.Offset(0, -2) <> "" [/B]Then [COLOR=Green]'Si la Cellule est marqué d'un x _
[B]'et la cellule de la même ligne et deux colonnes à gauche est remplie[/B][/COLOR]
Cellule.Interior.ColorIndex = 15 [COLOR=Green]'la Couleur de la cellule est Grisé[/COLOR]
Else[COLOR=Green] 'Sinon[/COLOR]
Cellule.Interior.ColorIndex = xlNone [COLOR=Green]'la Couleur de la cellule est Transparente[/COLOR]
End If [COLOR=Green]'Fin de la condition[/COLOR]
Next Cellule[COLOR=Green] 'Prochaine Cellule
[/COLOR] End Sub