Private Sub Worksheet_Change(ByVal Target As Range)
Dim xrg As Range, x, i&, col&
If Intersect(Target, Columns("f:g")) Is Nothing Then Exit Sub
For Each x In Intersect(Target, Columns("f:g")).Cells
x.Interior.ColorIndex = xlColorIndexNone: x.Font.ColorIndex = xlColorIndexAutomatic
col = IIf(x.Column = [f1].Column, 1, 2)
i = Application.IfError(Application.Match(x.Value, Columns(col), 0), 0)
If i > 0 Then x.Interior.Color = Cells(i, col).Interior.Color: x.Font.Color = Cells(i, col).Font.Color
Next x
End Sub