Sub Modifier_les_couleurs_d_une_cellule() 'OK
Dim CoulPol As Long
Dim RougePol As Integer
Dim VertPol As Integer
Dim BleuPol As Integer
Dim CoulFond As Long
Dim RougeFond As Integer
Dim VertFond As Integer
Dim BleuFond As Integer
Dim CelluleCible As Range
With ActiveCell
CoulPol = .Font.Color
CoulFond = .Interior.Color
End With
RougePol = CouleurRGB("Rouge", CoulPol)
VertPol = CouleurRGB("Vert", CoulPol)
BleuPol = CouleurRGB("Bleu", CoulPol)
RougeFond = CouleurRGB("Rouge", CoulFond)
VertFond = CouleurRGB("Vert", CoulFond)
BleuFond = CouleurRGB("Bleu", CoulFond)
Set CelluleCible = Application.InputBox(Prompt:="Sélectionner la plage à colorer (police + remplissage", Title:="Sélection d'une plage", Type:=8)
If RougeFond + VertFond + BleuFond = 3 * 255 Then
CelluleCible.Font.Color = RGB(RougePol, VertPol, BleuPol)
Else
With CelluleCible
.Font.Color = RGB(RougePol, VertPol, BleuPol)
.Interior.Color = RGB(RougeFond, VertFond, BleuFond)
End With
End If
End Sub