Sub Epurer()
Dim tablo, i&, x$, s, ub%, y$
With Sheets("Synthèse").UsedRange.Columns(3)
tablo = .Resize(, 2) 'matrice, plus rapide, au moins 2 éléments
For i = 2 To UBound(tablo)
x = tablo(i, 1)
s = Split(x)
ub = UBound(s)
If ub > -1 Then
y = LCase(s(ub))
If (y = "test" Or y = "essai") And ub > 0 Then tablo(i, 1) = Trim(Left(x, Len(x) - Len(s(ub - 1) & y) - 1))
If (y = "simul" Or y = "result") And ub > 1 Then tablo(i, 1) = Trim(Left(x, Len(x) - Len(s(ub - 2) & s(ub - 1) & y) - 2))
End If
Next
'---restitution---
If .Parent.FilterMode Then .Parent.ShowAllData 'si la feuille est filtrée
.Value = tablo
End With
End Sub