geoffreywolter
XLDnaute Nouveau
Bonjour, je cherche à ce que ce formatage soit applicable si la valeur de la cellule B (de la même ligne) est "A" , si la valeur est "B" le formatage conditionnel aura des valeurs differentes (au lieu de 2 à 9, 2 à 7 par exemple)
Merci.
Sub FormatageConditionnel()
Dim MaPlage As Range
Set MaPlage = Range("H:H")
MaPlage.FormatConditions.Delete
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=2", Formula2:="9"
MaPlage.FormatConditions(1).Interior.Color = RGB(0, 128, 0)
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=10", Formula2:="=15"
MaPlage.FormatConditions(2).Interior.Color = RGB(255, 255, 0)
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=16", Formula2:="=20"
MaPlage.FormatConditions(3).Interior.Color = RGB(255, 0, 0)
End With
End Sub
Merci.
Sub FormatageConditionnel()
Dim MaPlage As Range
Set MaPlage = Range("H:H")
MaPlage.FormatConditions.Delete
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=2", Formula2:="9"
MaPlage.FormatConditions(1).Interior.Color = RGB(0, 128, 0)
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=10", Formula2:="=15"
MaPlage.FormatConditions(2).Interior.Color = RGB(255, 255, 0)
MaPlage.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=16", Formula2:="=20"
MaPlage.FormatConditions(3).Interior.Color = RGB(255, 0, 0)
End With
End Sub