Bonjour,
Il te faut 2 boucles.
1 sur les phrases + 1 sur les mots clés.
Sub Catego()
Application.ScreenUpdating = False
Dim a As Long, i as Long, j As Long
Dim MotsCles
Dim ws_1 As Worksheet
Dim Cible1 As String
Sheets("detail").Activate
Set ws_1 = Worksheets("detail")
a = ws_1.Cells(Rows.Count, 2).End(xlUp).Row 'définir la dernière ligne utilisée
Cible1 = "Chaud,chaud,CHAUD,Chauffage,chauffage,CHAUFFAGE,chaufferie"
MotsCles = Split(Cible1, ",")
For i = 2 To a Step 1
For j = LBound(MotsCles) To UBound(MotsCles)
If InStr(MotsCles(j), ws_1.Cells(i, 14).Value) > 0 Then
ws_1.Cells(i, 30).Value = "Chaud"
End If
Next j
Next i
MsgBox ("Traitement terminé")
End Sub
Autre conseil, pour ne pas avoir à te soucier des majuscules/minuscules, tu peux tester comme ceci en ajoutant UCase(valeur de la cellule) :
Cible1 = "CHAUD,CHAUFFAGE,CHAUFFERIE"
MotsCles = Split(Cible1, ",")
For i = 2 To a Step 1
For j = LBound(MotsCles) To UBound(MotsCles)
If InStr(MotsCles(j), UCase(ws_1.Cells(i, 14).Value)) > 0 Then
ws_1.Cells(i, 30).Value = "Chaud"
End If