retrieving "Records Found"

G

Guest

When using VBA to access the Autofilter method, is there a way to access the
# of Records found?
 
T

Tom Ogilvy

Not really (since there is no guarantee it will be in the status bar), but
it is easy to get

dim rng as Range
set rng = Activesheet.autofilter.Range.columns(1).Cells

set rng = rng.specialcells(xlvisible)

msgbox "Records found: " & rng.count - 1

you subtract 1, because rng would include the header row.
 
G

Guest

THANK YOU.

I knew there had to be a way to get the information I needed. I just needed
to submit the question the right way.

You guys are the best. Microsoft chose their MVP's very well
 

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