Try:
Sub YourBossOwesMeLunch()
Dim ws As Worksheet: Set ws = Sheets("Sheet1")
Dim LR As Long, strRow As Long, miniLR As Long, sCell As Long, FinalRow As Long
Dim rng As Range, iFind As Range, icell As Range, myrng As Range
Dim iDelete As Boolean
Application.ScreenUpdating = False
LR = ws.Range("S" & Rows.Count).End(xlUp).Row
strRow = 2
Do Until strRow >= LR
miniLR = ws.Range("S" & strRow).End(xlDown).Row
Set rng = ws.Range("S" & strRow, "S" & miniLR)
For Each icell In rng
If icell.Row = miniLR Then
Set myrng = ws.Range("S" & strRow, "S" & miniLR - 1)
ElseIf icell.Row = strRow Then
Set myrng = ws.Range("S" & strRow + 1, "S" & miniLR)
Else
Set myrng = Union(Range("S" & strRow, "S" & icell.Row - 1), Range("S" & icell.Row + 1, "S" & miniLR))
End If
Set iFind = myrng.Find(What:=icell.Value, LookIn:=xlValues, LookAt:=xlWhole)
If iFind Is Nothing Then
iDelete = True
Exit For
End If
Next icell
If iDelete = True Then
rng.EntireRow.Interior.ColorIndex = 3
End If
strRow = ws.Range("S" & miniLR + 1).End(xlDown).Row
iDelete = False
Loop
For sCell = LR To 2 Step -1
If ws.Range("S" & sCell).Interior.ColorIndex = 3 Then
ws.Range("S" & sCell).EntireRow.Delete Shift:=xlUp
End If
Next sCell
If IsEmpty(ws.Range("S2")) Then
FinalRow = ws.Range("S2").End(xlDown).Row
ws.Range("S2:S" & FinalRow - 1).EntireRow.Delete Shift:=xlUp
End If
Application.ScreenUpdating = True
End Sub
Bookmarks