No match on Advanced Filter -- how to detect?

D

Dianne

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?
 
D

Dianne

Sigh. Never mind --

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

If lngNumRowsVisible < 65536 Then
code
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top