Private Sub Worksheet_Change(ByVal Target As Range)
Cells.EntireRow.Hidden = False
If Target.Value = vbNullString Then Exit Sub
If Target.Address = "$B$2" Then
Application.ScreenUpdating = False
For i = 5 To Range("A" & Rows.Count).End(xlUp).Row
Rows(i).Hidden = IIf(Range("A" & i).Value = Target.Value, False, True)
Next i
Application.ScreenUpdating = True
End If
End Sub