First remove the current filter completely as you are using row 14 as a header so it will always be visible. Then right-click the Report Details tab, choose View Code and then paste this in:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lLastRow As Long
On Error GoTo catch
If Not Intersect(Target, Range("D3")) Is Nothing Then
Application.EnableEvents = False
lLastRow = Cells(Rows.Count, "B").End(xlUp).Row
If Right$(LCase$(Range("D3").Value), 8) = "_trigger" Then
Range("D13:D" & lLastRow).AutoFilter field:=1, Criteria1:=Range("D3").Value & "*"
Else
Range("D13:D" & lLastRow).AutoFilter field:=1, Criteria1:=Range("D3").Value & "*", Operator:=xlAnd, Criteria2:="<>" & Range("D3").Value & "_Trigger*"
End If
End If
catch:
Application.EnableEvents = True
End Sub
Bookmarks