Just in case, do you really need a macro for this? You can do this with formulas
Add an extra column with COUNTIF function, and calculated number of entries for each name
Then set conditional formatting for rows where COUNTIF = 1 and Status = Expired.
With a macro,you can do it with something this
Sub Test3()
Dim count, i As Long
Dim rng As Range
Set rng = Range(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(UsedRange.Rows.count, 1))
rng.Select
count = UsedRange.Rows.count
i = 2
Do While i <= count
If Cells(i, 3).Value Like "Expired" And Application.WorksheetFunction.CountIf(rng, Cells(i, 1)) = 1 Then
Range(Cells(i, 1), Cells(i, 5)).Interior.Color = RGB(230, 98, 76)
ElseIf Cells(i, 3).Value Like "Current" Then
Range(Cells(i, 1), Cells(i, 5)).Interior.Color = RGB(118, 234, 62)
End If
i = i + 1
Loop
End Sub
Bookmarks