conditional counting of autolist cells/rows

J

johli

Having a bit of a problem with autolist/count function

Have written a function for counting visible cells for an autolist.
Was hoping that the following code would work:
Rng is the range for the autolist column in question:

rng.SpecialCells(xlCellTypeVisible).count - should count the visible
cells.

this counts all rows not just the visible ones...

would like to use countif to count conditionally to like:

worksheetfunction.CountIf(rng.SpecialCells(xlCellTypeVisible),3) -
should count visible cells with he value 3 in he appropriate column...

Probably me being stupid but why doesn't it work, please help!!

/Johan Litsén
 

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