Hi,
This a a simple code. Paste to a module.
![]()
Sub test() Application.ScreenUpdating = False Dim myname As String Dim cel As Range, mcell As Range, fcell As Range, male As Range, female As Range For Each cell In Range("A1").CurrentRegion If cell.Text <> "" Then myname = cell.Text With Sheets("Sheet2") For Each mcell In Sheets("Sheet2").Range("male") If mcell.Text = myname Then cell.Interior.ColorIndex = 4 End If Next mcell For Each fcell In Sheets("Sheet2").Range("female") If fcell.Text = myname Then cell.Interior.ColorIndex = 3 End If Next fcell End With End If Next cell End Sub
Bookmarks