Private Function TrimDownColor(ByRef strCode As String, ByVal début_normal As String, ByVal début_mot As String, ByVal fin_mot As String) As String
Dim bytCar As Byte
Dim intFindFirst As Integer, intFindNext As Integer, intFindNormal As Integer
intFindNext = 1
On Error Resume Next
Do
intFindFirst = InStr(intFindNext, strCode, début_mot)
intFindNext = InStr(intFindFirst + 1, strCode, début_mot)
intFindNormal = InStr(intFindFirst, strCode, début_normal)
If Err Then
Err.Clear
On Error GoTo 0
Exit Do
End If
If intFindNext = 0 Then
Select Case intFindNormal
Case Is > intFindNext, 0
If InStr(intFindFirst + 1, strCode, fin_mot & Chr$(32) & début_mot) > 0 Then
strCode = Mid(strCode, 1, intFindNext - 10) & Chr$(32) & Replace(strCode, fin_mot & Chr$(32) & début_mot, '', intFindNext - 9, 1)
Else
strCode = Mid(strCode, 1, intFindNext - 9) & Replace(strCode, fin_mot & début_mot, '', intFindNext - 10, 1)
End If
End Select
Else
Exit Do
End If
Loop Until InStr(intFindNext, strCode, début_mot) = 0
TrimDownColor = strCode
On Error GoTo 0
End Function