ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   No match on Advanced Filter -- how to detect? (https://www.excelbanter.com/excel-programming/281612-no-match-advanced-filter-how-detect.html)

Dianne

No match on Advanced Filter -- how to detect?
 
I have a user form that allows the user to filter data. If they filter
the data, I colour a few cells red so that they have a visual cue that
some rows are hidden.

However, if their criteria don't match any data in the database, then no
rows are hidden even though I have applied an advanced filter. If this
is the case, I don't want the cells coloured red.

I can count visible rows before the advanced filter and compare to
visible rows after the advanced filter, but I was wondering if there
might be a simpler way?

Activesheet.FilterMode = True after the advanced filter even if there
are no hidden rows, so that's out.

Any suggestions?

--
Dianne



Dianne

No match on Advanced Filter -- how to detect?
 
Sigh. Never mind --

lngNumRowsVisible = Range("A:A").SpecialCells(xlCellTypeVisible).Count

If lngNumRowsVisible < 65536 Then
code
End if

--
Dianne


In ,
Dianne typed:
I have a user form that allows the user to filter data. If they filter
the data, I colour a few cells red so that they have a visual cue that
some rows are hidden.

However, if their criteria don't match any data in the database, then
no rows are hidden even though I have applied an advanced filter. If
this is the case, I don't want the cells coloured red.

I can count visible rows before the advanced filter and compare to
visible rows after the advanced filter, but I was wondering if there
might be a simpler way?

Activesheet.FilterMode = True after the advanced filter even if there
are no hidden rows, so that's out.

Any suggestions?





All times are GMT +1. The time now is 01:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com