Sub insertConditions()
Dim row As Integer
Dim col As Integer
Dim formula As String
Dim cell
row = 8
On Error Resume Next
While row < 25
formula = "=$D" & Trim(Str(row))
col = 5
While col < 16
If Cells(row, col).FormatConditions(1).Formula1 <> formula Or _
Cells(row, col).FormatConditions(3).Formula1 <> formula Then
Call modifyConditions(row, col, formula)
End If
col = col + 1
Wend
row = row + 1
Wend
On Error GoTo 0
End Sub
Private Sub modifyConditions(row As Integer, col As Integer, formula As String)
Cells(row, col).FormatConditions.Delete
Cells(row, col).FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=formula
Cells(row, col).FormatConditions(1).Font.ColorIndex = 51
Cells(row, col).FormatConditions(1).Interior.ColorIndex = 35
Cells(row, col).FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""Non installé"""
Cells(row, col).FormatConditions(2).Font.ColorIndex = 2
Cells(row, col).FormatConditions(2).Interior.ColorIndex = 3
Cells(row, col).FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, _
Formula1:=formula
Cells(row, col).FormatConditions(3).Interior.ColorIndex = 40
End Sub