Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$1" Then
Dim LR As Long, Found
Application.EnableEvents = False
Cells.EntireRow.Hidden = False
LR = Cells(Rows.Count, "D").End(xlUp).Row
If Not IsEmpty(Target) Then
Set Found = Range("D2:D" & LR).Find(Target.Value)
If Found Is Nothing Then
Cells.EntireRow.Hidden = False
Else
Rows("2:" & LR).EntireRow.Hidden = True
Found.Resize(6, 1).EntireRow.Hidden = False
End If
Else
Cells.EntireRow.Hidden = False
End If
Application.EnableEvents = True
End If
End Sub