1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Sub Gras()
On Error GoTo GE:
Dim feuille As Worksheet
Dim i, j, k, N As Integer
Dim c As Range
Dim A
Mot="coucou"
Sheets(3).Select
j = Len(Mot)
Set feuille = Worksheets("Recherche par mots clés")
Cells(12, 7).Select
Selection.End(xlDown).Select
k = ActiveCell.Row
i = 12
For Each c In Range(Cells(12, 7), Cells(k, 7))
Cells(i, 7).Select
If c.Value Like "*" & Mot & "*" Then
A = Cells(i, 7).Value
N = Application.Search(Mot, A, 1)
If N <> 0 Then
With Worksheets(3).Cells(i, 7)
.Characters(N, j).Font.Bold = True
End With
End If
End If
i = i + 1
Next
Exit Sub
GE:
MsgBox "Erreur N° " & Err.Number & " : " & Err.Description, vbExclamation
End Sub |
Partager