Gringoire
Board Regular
- Joined
- Nov 18, 2016
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
Hello guys,
I'm using the below code on a Table containing about 25.000 rows
After filtering, about 5000 rows are still visible (I checked directly on my table) but even if the range rtotals still counts 25000 rows, the range rvisible only counts one or few rows (depending from filter arguments).
the size of rvisible seems to be stopped at the first row hidden by the filter.
it seems a strange behavior to me, because "SpecialCells(xlCellTypeVisible)" should skip the hidden rows, not stop at them...
any hint?
I'm using the below code on a Table containing about 25.000 rows
After filtering, about 5000 rows are still visible (I checked directly on my table) but even if the range rtotals still counts 25000 rows, the range rvisible only counts one or few rows (depending from filter arguments).
the size of rvisible seems to be stopped at the first row hidden by the filter.
it seems a strange behavior to me, because "SpecialCells(xlCellTypeVisible)" should skip the hidden rows, not stop at them...
any hint?
VBA Code:
Function voceDiStima()
'*** FILTERING ROWS
With shRawData.ListObjects("TabRawData").DataBodyRange
.AutoFilter
.AutoFilter Field:=6, Criteria1:="C06065", Operator:=xlFilterValues
.AutoFilter Field:=34, Criteria1:="*-II0*", Operator:=xlFilterValues
End With
Dim rtotal as Long, rvisible as Long
rtotal= shRawData.ListObjects("TabRawData").DataBodyRange.Columns(8).Rows.Count
rvisible=shRawData.ListObjects("TabRawData").DataBodyRange.Columns(8).SpecialCells(xlCellTypeVisible).Rows.Count
End Function
Last edited: