Assuming Header starts from A1 and the data starts from A3.
If this doesn't work on your side, upload your workbook.
Sub test()
Dim rng As Range
Application.ScreenUpdating = False
With Range("a3").CurrentRegion
With .Offset(-2).Resize(.Rows.Count + 2)
Set rng = .Offset(, .Columns.Count + 2).Range("a1:a2")
rng(2).Formula = "=and(" & .Cells(1, 2).Address(0, 0) & "=2," & _
.Cells(1, .Columns.Count).Address(0, 0) & "=2)"
.AdvancedFilter 1, rng
On Error Resume Next
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(12).Select
On Error GoTo 0
.Parent.ShowAllData: rng.Clear
End With
End With
Application.ScreenUpdating = True
End Sub
Bookmarks