Hello,
I have run into an issue with counting the number of visible rows in a table after it has been filtered. I can get the total row count but not the visible rows only.
I've tried several methods as well, but everything that I've research uses a column range like "A2:A" which isn't helpful in this cause since the name of the table's column is dynamic.
Worksheet Nam variable example: part_path_worksheet_name
Table Name variable example: part_path_number_table
Column Name: "Part Path"
Total row count unfiltered without column header: 510
Expected row count after without column header filter: 40
I do not use the total column row count - 1 method since the .ListsObjects method works for the normal column count.
Filter Code:
one of the row count codes I've tried:
I figure that it is a simple solution that I am overlook. My Google Foo has been a little off recently.
Thanks for the help,
Mike
I have run into an issue with counting the number of visible rows in a table after it has been filtered. I can get the total row count but not the visible rows only.
I've tried several methods as well, but everything that I've research uses a column range like "A2:A" which isn't helpful in this cause since the name of the table's column is dynamic.
Worksheet Nam variable example: part_path_worksheet_name
Table Name variable example: part_path_number_table
Column Name: "Part Path"
Total row count unfiltered without column header: 510
Expected row count after without column header filter: 40
I do not use the total column row count - 1 method since the .ListsObjects method works for the normal column count.
Filter Code:
Code:
ThisWorkbook.Sheets(part_path_worksheet_name).ListObjects(part_path_number_table).Range.AutoFilter Field:=rules_finish_length_min_index, _
Criteria1:=rules_finish_length_min_value
one of the row count codes I've tried:
Code:
rule_finish_length_min_result_count = ThisWorkbook.Sheets(part_path_worksheet_name).ListObjects(part_path_number_table).Range("part_path_number_table[Part Path]").SpecialCells(xlCellTypeVisible).Rows.Count
I figure that it is a simple solution that I am overlook. My Google Foo has been a little off recently.
Thanks for the help,
Mike