I have a table with multiple columns with automatic filtering.
One of my columns has automatic month filtering, which takes the following code.
ActiveSheet.ListObjects("Salary").Range.AutoFilter Field:= _
Application.WorksheetFunction.Match("Mounth", Range("Salary[#Headers]"), 0), _
Criteria1:="=09"
Sometimes I need to provide a value for the filter criteria of this column to assign a variable. Therefore, it is always unknown what the filtered value is.
Of course, the user can select more than one item from the table header menu drop-down list, as the code action is below:
ActiveSheet.ListObjects("Salary").Range.AutoFilter Field:= _
Application.WorksheetFunction.Match("Mounth", Range("Salary[#Headers]"), 0), _
Criteria1:="=09", Operator:=xlOr, Criteria2:="=08"
How can I catch all the ones selected in the array or make sure that the selected value is unique and assign it to the same variable?
source
share