Bonjour à tous,
Je reviens vers vous pour m'aider à solutionner ce problème, un détail doit m'échapper mais lequel??...
La macro a pour but de colorer des cellules en fonction de valeur d'autres cellules. La macro fonctionne mais aboutit à un débogage systématique en me soulignant la 1ère ligne "If...", je pense à une erreur de syntaxe mais laquelle??
C'est pour cela que j'ai besoin de vous; voici la macro
Public Sub prcalerte()
Dim i As Integer
For i = 3 To 200
If (Cells(i, 12).Value = "" And Cells(i, 11).Value = "Ok") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If (Cells(i, 12).Value = "" And Cells(i, 11).Value = "Vérifier départ") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If (Cells(i, 12).Value <> "" And Cells(i, 11).Value = "Vérifier départ") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 6
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next i
End Sub
Merci d'avance
Cordialement
Adriano43
Je reviens vers vous pour m'aider à solutionner ce problème, un détail doit m'échapper mais lequel??...
La macro a pour but de colorer des cellules en fonction de valeur d'autres cellules. La macro fonctionne mais aboutit à un débogage systématique en me soulignant la 1ère ligne "If...", je pense à une erreur de syntaxe mais laquelle??
C'est pour cela que j'ai besoin de vous; voici la macro
Public Sub prcalerte()
Dim i As Integer
For i = 3 To 200
If (Cells(i, 12).Value = "" And Cells(i, 11).Value = "Ok") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If (Cells(i, 12).Value = "" And Cells(i, 11).Value = "Vérifier départ") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If (Cells(i, 12).Value <> "" And Cells(i, 11).Value = "Vérifier départ") Then
Cells(i, 11).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 6
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next i
End Sub
Merci d'avance
Cordialement
Adriano43