1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub test1(Mot)
Dim c As Range, ResAdr As String, Debut As Integer, Res As Integer
Application.ScreenUpdating = False
Set c = [Feuil1!A:C].Find(Mot)
If Not c Is Nothing Then
ResAdr = c.Address
Do
Res = 0
Debut = InStr(1, c.Value, Mot)
Do While Debut > 0 And Debut > Res
With c.Characters(InStr(Debut, c.Value, Mot), Len(Mot)).Font
.Color = -4165632
.Bold = True
End With
c.Characters(InStr(Debut, c.Value, Mot), Len(Mot)).Text = "***"
Res = Debut
Debut = InStr(1, c.Value, Mot)
c.Characters(InStr(Res, c.Value, "***"), Len(Mot)).Text = Mot
Loop
Set c = [Feuil1!A:C].FindNext(c)
Loop While c.Address <> ResAdr
End If
Application.ScreenUpdating = True
End Sub |
Partager