How to check row is hidden when apply filter
You can count the visible cells in a column in the autofilter range:
With activesheet.autofilter.range.columns(1)
if .cells.count = .cells.specialcells(xlcelltypevisible).cells.count then
'all visible
else
'not all visible
end if
end with
But that doesn't tell you if the data has been filtered--it could be that all
the cells in the filter meet the criteria, so that all rows are visible.
If that is important, you may want to check something like:
With activesheet
if .autofiltermode = true then
'there are autofilter arrows on the worksheet
if .filtermode then
'some filter is applied
'maybe show all the data
.showalldata '????
end if
end if
end with
moonhk wrote:
Hi All
For Excel 2003
When Apply Filter , How to check the row have been filtered out ?
Below coding include filtered out row.
iRows = Application.Selection.Rows.Count
iCols = Application.Selection.Columns.Count
For ir = 1 To iRows
....
Next
--
Dave Peterson
|