Try this macro.
Option Explicit
Sub Test()
Dim N As Long
Dim URNRow As Long
For N = 2 To Sheets("Sheet1").Cells(Rows.Count, 13).End(xlUp).Row
If WorksheetFunction.CountIf(Sheets("Sheet2").Range(Sheets("Sheet2").Columns(5), Sheets("Sheet2").Columns(10)), Sheets("Sheet1").Cells(N, 13)) > 0 Then
URNRow = Sheets("Sheet2").Range(Sheets("Sheet2").Columns(5), Sheets("Sheet2").Columns(10)).Find(Sheets("Sheet1").Cells(N, 13), , xlValues, xlWhole).Row
If Sheets("Sheet2").Cells(URNRow, 3).MergeArea(1) = Sheets("Sheet1").Cells(N, 31) Then
Sheets("Sheet1").Cells(N, 13).Interior.Color = Sheets("Sheet2").Cells(URNRow, 2).MergeArea(1).Interior.Color
End If
End If
Next N
End Sub
Open up the VBA editor by hitting ALT F11
Insert a new module by hitting Insert - Module
Paste the macro into the empty sheet
Hit ALT F11 to get back to the worksheet.
Run the macro by going the view ribbon in Excel
Bookmarks