Переделал 9/2, ненужные коды сданы
Вы можете попробовать это:
Sub sameStringRed()
Dim i As Integer, j As Integer, intStart As Integer
Dim rngA As Range, rngB As Range
Dim strDelimit As String: strDelimit = " "
For Each rngA In Selection.Rows
Set rngB = rngA.Offset(0, 1)
On Error GoTo Error
strA = Split(rngA.Text, strDelimit)
strB = Split(rngB.Text, strDelimit)
For j = LBound(strA) To UBound(strA)
For i = LBound(strB) To UBound(strB)
If strA(j) = strB(i) Then
intStart = InStr(1, UCase(rngA.Value), UCase(strB(i)))
While intStart > 0
If Mid(rngA, intStart + Len(strB(i)), 1) = strDelimit Or Mid(rngA, intStart + Len(strB(i)), 1) = "" Then
rngA.Characters(Start:=intStart, Length:=Len(strB(i))).Font.ColorIndex = 3
End If
intStart = InStr(intStart + 1, UCase(rngA.Value), UCase(strB(i)))
Wend
End If
Next i
Next j
Next
Exit Sub
Error:
MsgBox "Please do not select multiple columns"
End Sub