Sub Enfourner()
Dim xshp As Shape, xcell As Range, couleur
Set xshp = Me.Shapes(Application.Caller)
Set xcell = ActiveCell
couleur = xshp.Fill.ForeColor
xcell = xshp.TextFrame2.TextRange
RazFormat xcell
PlacerFormat xcell, couleur
End Sub
Sub Effacer()
ActiveCell.ClearContents
RazFormat ActiveCell
ActiveCell.Font.Bold = False
ActiveCell.HorizontalAlignment = xlCenter
End Sub
Sub RazFormat(x As Range)
Dim i&
For i = x.FormatConditions.Count To 1 Step -1
If x.FormatConditions(i).Text Like "FOUR*" Then x.FormatConditions(i).Delete
Next i
End Sub
Sub PlacerFormat(x As Range, xcouleur)
Dim i&
RazFormat x
x.FormatConditions.Add Type:=xlTextString, String:="FOUR ", TextOperator:=xlBeginsWith
x.FormatConditions(1).SetFirstPriority
x.FormatConditions(1).StopIfTrue = True
x.FormatConditions(1).Interior.Color = xcouleur
x.Font.Bold = True
x.HorizontalAlignment = xlCenter
End Sub