1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub test()
Dim derli As Long
Dim i As Long
derli = Columns(5).Find("*", , , , , xlPrevious).Row
For i = derli To 1 Step -1
'si fond cellule E en bleu
If Cells(i, "E").Interior.ColorIndex = 41 Then
'on verifie fond cellule H
Select Case Cells(i, "H").Interior.ColorIndex
'si vert, on supprime la ligne
Case 42: Rows(i).Delete
'si pas de formatage de la couleur de fond pb de montant en K
Case -4142: Cells(i, "K") = "pb de montant"
End Select
'Si fond cellule E non formaté et fond cellule H en vert,
'pb de facture en K
ElseIf Cells(i, 5).Interior.ColorIndex = -4142 And _
Cells(i, "H").Interior.ColorIndex = 42 Then
Cells(i, "K") = "pb de facture"
End If |
Partager