countif constants in a Range

I

ibeetb

I have a range of 20 cells in a range. These cells are mixed with constants,
blanks, and formulas. I want to do a countif (via code) of the cells in the
range which hold constants ONLY. I though the haveformula property would
work, but this property seems to be absolute....counting all or none based
on if there is an instance of a formula in any of the cells in this range

can someone please assist.....

Thank you
 
A

Alan Beban

See if rng.SpecialCells(xlConstants).Count returns your desired result.

Alan Beban
 

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