Option Explicit
'Rechercher et extraire un mot dans une chaîne de caractères
Sub Rech_Mot()
Dim plage As Range, cel As Range, mot$, txt$
With Sheets(4)
Set plage = .Range("a2:a" & .Range("a" & .Rows.Count).End(xlUp).Row)
mot = .Range("c2").Value
End With
For Each cel In plage
If RechMot(LCase(cel.Value), LCase(mot)) Then
cel.Offset(0, 1) = mot
Else
MsgBox mot & " n'est pas dans la phrase.", , "ERREUR"
Exit For
End If
Next cel
End Sub
Function RechMot(txt As String, mot As String) As Boolean
Dim Pos&
Pos = 0
Pos = InStr(txt, mot)
RechMot = Pos > 0
End Function