Salut Moreauste,
Salut BsAlv
@BsAlv : toujours sur les bons coups, toi!
Perso, je privilégie toujours VBA, étant quasi nul en formules!
En l'état, ma macro ne se déclenche actuellement que sur un double-clic sur la cellule texte que tu veux traiter avec résultat en [C10].
Tes mots-clés sont dans 'DATA', liste que tu peux modifier à ton aise.
Tu peux (pas encore programmé) modifier l'ordre de tes mots-clés en les numérotant en [A:A].
La colonne [C:C] est utilisée par la macro.
L'objectif final est évidemment de déclencher la macro au moindre changement d'une cellule-texte ou de la liste des mots-clés avec affichage sur la cellule même!
Mais, ayant du boulot ici, je m'y mettrai plus tard si cette solution te convient!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim iRow%, iTRow%, iPos1%, iPos2%, sMsg1$, sMsg2$
'
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
'
With Worksheets("DATA")
If Not Intersect(Target, Columns(3)) Is Nothing Then
If Target <> "" Then
sMsg1 = Target
iRow = .Range("B" & Rows.Count).End(xlUp).Row
For x = 1 To 2
For y = 1 To iRow
If x = 1 Then .Cells(y, 3) = InStr(sMsg1, .Cells(y, 2))
If x = 2 Then
iTRow = .Columns(1).Find(what:=y, lookat:=xlWhole, LookIn:=xlValues, searchdirection:=xlNext).Row
If .Cells(iTRow, 3) > 0 Then
iPos1 = .Cells(iTRow, 3)
iPos2 = IIf(.Cells(iTRow + 1, 2) <> "", .Cells(iTRow + 1, 3), Len(sMsg1) + 1)
If Asc(Mid(sMsg1, iPos2 - 1, 1)) < 32 Then iPos2 = iPos2 - 1
sMsg2 = sMsg2 & IIf(y = 1, "", vbLf) & Mid(sMsg1, iPos1, (iPos2 - iPos1))
End If
End If
Next
.Range("A1:C" & iRow).Sort key1:=.Range(IIf(x = 1, "C1", "A1")), order1:=xlAscending, Orientation:=xlTopToBottom
Next
Cells(10, 3) = sMsg2
End If
End If
End With
'
Application.ScreenUpdating = True
Application.EnableEvents = True
'
End Sub
A+