Hello, Yes there is a header in sheet 5 data starting in row 2. Column U is populated with Data for all rows. All columns are included in the filter but want filter to be based on value in Column U as this matches Column A on sheet 2. If that makes sense.Does your data on Sheet 5 begin with a header in row 1 and data starting on row 2?
Is column U populated for every row on Sheet 5 with data?
What columns are to be included in your filter?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim f As Variant
Dim ws5 As Worksheet
Dim lr As Long
' Ignore row 1
If Target.Row = 1 Then Exit Sub
' Ignore anything outside of column A
If Target.Column > 1 Then Exit Sub
' Set worksheet variable
Set ws5 = Sheets("Sheet5")
' Grab value to use in filter
f = Target.Value
' Find last row with data on Sheet5
lr = ws5.Cells(ws5.Rows.Count, "U").End(xlUp).Row
' Apply to filter on Sheet 5
ws5.Activate
ws5.Range("A1:U" & lr).AutoFilter Field:=21, Criteria1:=f
End Sub