I need to find the one table (one worksheet will only have one Table) in the Active worksheet and find the first & last column in that table and remove the auto filter from those first and last columns.
Currently I am doing this:- The problem is I have to manually input the Field values as the name of the sheet will change as well as the name of the table
Private Sub Worksheet_Activate()
' Select middle cell
ActiveSheet.Range("$A$1").Select
' Remove autofilter from first column in the table
With Range("$A$2")
.AutoFilter Field:=1, VisibleDropDown:=False
End With
' Remove autofilter from last column in the table
With Range("$Q$2")
.AutoFilter Field:=17, VisibleDropDown:=False
End With
End Sub