View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
moonhk[_2_] moonhk[_2_] is offline
external usenet poster
 
Posts: 36
Default How to check row is hidden when apply filter

On 2月11日, 上午9時17分, Dave Peterson wrote:
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


Hi All

When Apply filter , some row have been hidden, When I select some row
to process. the hidden also selected. How to check the row is filter
out by filters ?

e.g.
line 1
line 2 <- Filter out
line 3

When select line1 to line3 , the filter out still selected within
blelow for loop

For ir = 1 To iRows
.....
Next





moonhkt