Re : problème de couleur avec remplacer par
Merci çà marche super bien voici mon code
j ai encore une requête (je sais j 'abuse)
est t il possible de faire le remplacement sur !C par un cœur
cela évitera de changer des les mots avec un c majuscule
merci
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Byte
If Target.Count > 1 Then Exit Sub
i = InStr(Target, "C")
Do While i > 0
On Error GoTo fin
Application.EnableEvents = False
With Target.Characters(i, 1)
.Text = Chr(169)
With .Font
.Name = "Symbol"
.ColorIndex = 3
End With
End With
i = InStr(Target, "C")
Loop
i = InStr(Target, "T")
Do While i > 0
On Error GoTo fin
Application.EnableEvents = False
With Target.Characters(i, 1)
.Text = Chr(167)
With .Font
.Name = "Symbol"
.ColorIndex = 1
End With
End With
i = InStr(Target, "T")
Loop
i = InStr(Target, "K")
Do While i > 0
On Error GoTo fin
Application.EnableEvents = False
With Target.Characters(i, 1)
.Text = Chr(168)
With .Font
.Name = "Symbol"
.ColorIndex = 3
End With
End With
i = InStr(Target, "K")
Loop
i = InStr(Target, "P")
Do While i > 0
On Error GoTo fin
Application.EnableEvents = False
With Target.Characters(i, 1)
.Text = Chr(170)
With .Font
.Name = "Symbol"
.ColorIndex = 1
End With
End With
i = InStr(Target, "P")
Loop
fin:
Application.EnableEvents = True
End Sub