June 15, 2022
Is it possible to just exclude a value from a filter without specifying all the other values that are included?
I want to include all values, except "Closed/Transferred"
I want to use it on many sheets I use, in all cases the other values vary, and even the "Closed/Transferred" is not always field 7
This is a recording:
ActiveSheet.ListObjects("InputTable4").Range.AutoFilter Field:=7, Criteria1 _
:=Array("1. Allocated", "2. Assessment Ongoing", _
"3. Assessment Completed, Ongoing Work", "4. Support Planning", "5. To Be Closed" _
, "6. Safeguarding/VARM/COP/Finance", "7. On Recovery Plan", "="), Operator:= _
xlFilterValues
Trusted Members
Moderators
November 1, 2018
Trusted Members
Moderators
November 1, 2018
Your existing code used Field:=7 so I used the same. If your table layout might change, then you can get the index from the listcolumn like so:
Dim tb as Listobject
set tb = ActiveSheet.ListObjects("InputTable4")
tb.Range.AutoFilter Field:=tb.listcolumns("Current Stage in Process").index, Criteria1:="<>Closed/Transferred"
Answers Post
1 Guest(s)