baitmaster
Well-known Member
- Joined
- Mar 12, 2009
- Messages
- 2,042
Hello all
I have a range of data, and have autofiltered it. I am trying to count the number of rows remaining, using
This usually returns the correct value, except in some scenarios, where the first 8 (or so) lines of data are hidden. In this scenario, the value returned = 1
The header row (row 1 of the range) is always visible, its where the autofilter boxes appear, and contains labels. The last row always disappears, its a dummy line to act as the bottom border of the table, and contains no data
Ive tried other things as a test; notably, I split the code, so that the visible range only is selected, and then used selection.rows.count. Im expecting to see 100 or so, because that many rows are now selected. Still I get 1
Are there any known issues that would cause this? It only seems to occur when rows 2:x are hidden by autofilter
I'm using xl2007, but not a "table", as I am trying to maintain backwards compatibility
Thanks
I have a range of data, and have autofiltered it. I am trying to count the number of rows remaining, using
Code:
Range("rosterMatrixAll").SpecialCells(xlCellTypeVisible).Rows.Count
This usually returns the correct value, except in some scenarios, where the first 8 (or so) lines of data are hidden. In this scenario, the value returned = 1
The header row (row 1 of the range) is always visible, its where the autofilter boxes appear, and contains labels. The last row always disappears, its a dummy line to act as the bottom border of the table, and contains no data
Ive tried other things as a test; notably, I split the code, so that the visible range only is selected, and then used selection.rows.count. Im expecting to see 100 or so, because that many rows are now selected. Still I get 1
Are there any known issues that would cause this? It only seems to occur when rows 2:x are hidden by autofilter
I'm using xl2007, but not a "table", as I am trying to maintain backwards compatibility
Thanks