I have searched and searched for an answer to this, and have found many variations, but can't figure out how to loop through all filters on a table column. Example: Loop through each filterable value in column A, to perform a function on the visible cells. I have found ways to do so when setting the column filter criteria to something specific (I.E 'Cat'), but I want to go through each one by loop.
Can this be done by referencing the filter values by index or something similar? Below is the code I have found to loop through the visible cells, but I need to add a preceding loop to adjust the filters on that specific column...
Any help is appreciated!
Sub TestFilteredTable()
Dim tbl As ListObject
Dim rngTable As Range
Dim rngArea As Range
Dim rngRow As Range
Set tbl = ActiveSheet.ListObjects(1)
Set rngTable = tbl.DataBodyRange.SpecialCells(xlCellTypeVisible)
'Filtered Table Address
Debug.Print "Filtered table: " & rngTable.Address
'Add Loop Here to iterate through specific column filter items
'Loop through each area
For Each rngArea In rngTable.Areas
Debug.Print " Area: " & rngArea.Address
'Loop through visible rows
For Each rngRow In rngArea.Rows
Debug.Print " Row: " & rngRow.Address
Next
Next
'Close filter loop
End Sub