Sub Test()
Dim cell As Range, rg As Range
For Each cell In Range("E4:E19")
If cell.Interior.ColorIndex <> 2 Then
For Each rg In Range("D4:D19")
If cell.Value = rg.Value Then rg.Interior.ColorIndex = cell.Interior.ColorIndex
Next rg
End If
Next cell
End Sub
Sub TestB()
Dim cell As Range, rg As Range
For Each cell In Range("E4:E19")
If cell.Interior.Color <> 16777215 Then
For Each rg In Range("D4:D19")
If cell.Value = rg.Value Then rg.Interior.Color = cell.Interior.Color
Next rg
End If
Next cell
End Sub
Sub test()
Dim r As Range, c As Range, ff As String
Columns("e").Interior.ColorIndex = xlNone
For Each r In Range("d4", Range("d" & Rows.Count).End(xlUp))
If (r.Value <> "") * (r.Interior.ColorIndex <> xlNone) Then
Set c = Columns("e").Find(r.Text, , -4163, 1)
If Not c Is Nothing Then
ff = c.Address
Do
c.Interior.Color = r.Interior.Color
Set c = Columns("e").FindNext(c)
Loop Until ff = c.Address
End If
End If
Next
End Sub