bonjour,
je souhaite faire ressortir dans un tableau les anomalies .pour ce faire j'ai écrit ça. ce n'est pas concluant.
Sub Anomalie()
Dim ligne As Integer
ligne = 10
Do While Cells(ligne, 1).Value <> ""
Cells.FormatConditions.Delete
If Cells(ligne, 5).Value = "9" Then
Dim plage As Range
Cells.FormatConditions.Delete
Set plage = Range("f10:f150")
With plage
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=F10<>""5""" Or "=F10<>""4"""
.FormatConditions(plage.FormatConditions.Count).SetFirstPriority
End With
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Color = -16776961
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
End If
ligne = ligne + 1
Loop
End Sub
je n'arrive pas à écrire cette partie qui bug
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=F10<>""5""" Or "=F10<>""4"""
je vous joint le fichier
merci de votre aide par avance
Philippe