I found this code online that counts the number of cells in a certain range with a specified font color. (Each of my cells have either red or black text, and I wanted to sum the number of cells with black text, and the number of cells with red text.) The code can be found here:
http://www.xldynamic.com/source/xld.ColourCounter.html
I thought I was using the code incorrectly since I'm fairly new to excel and the results returned were way off. However, it appears that for some reason it is counting cells with no text. I checked this by changing the default color of the blank cells within the range to some other color (not red or black). I then got accurate results.
Does anybody have any idea on why this is happening, or how I can prevent it. Having to assign a font color to the blank cells greatly decreases the usefulness of this code.
Thanks
Mark
Bookmarks