Conditional Formatted Colored Cells

R

Richard P

I am trying to count the number of "conditionally formatted cells" in Excel
2003 - SR2 using VB looking for SPECIFIC colors (Red, Green or Yellow). I
cannot do it with a macro or simple formula. I can create a VB code that
counts the colored cells but NOT if they are conditionally formatted colored
cells. Any ideas?

I have tried using lCol = rColor.Interior.ColorIndex to determine the
color index (normally Red, Green or Yellow) and, as stated, it only counts
those cells colored using the format tool bar and NOT conditionally set by a
formula or cell value as set. Thanks.
 
J

Jim Cone

This is not a trivial undertaking.
You first have to determine if the cell is conditionally formatted
and then determine which of the CF formulas applied to the
cell are operative. Bob Phillips has more information and sample
VBA code at his website...
http://www.xldynamic.com/source/xld.CFConditions.html

I have a free "Determine Colors" Excel add-in available upon request.
It displays all the color particulars for a cell on the cell right-click
pop-up menu. It could be helpful to color-blind Excel users.
Remove the xxx from my email address. Be sure to include your
name and location if requesting the add-in.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Richard P" <Richard (e-mail address removed)>
wrote in message
I am trying to count the number of "conditionally formatted cells" in Excel
2003 - SR2 using VB looking for SPECIFIC colors (Red, Green or Yellow). I
cannot do it with a macro or simple formula. I can create a VB code that
counts the colored cells but NOT if they are conditionally formatted colored
cells. Any ideas?

I have tried using lCol = rColor.Interior.ColorIndex to determine the
color index (normally Red, Green or Yellow) and, as stated, it only counts
those cells colored using the format tool bar and NOT conditionally set by a
formula or cell value as set. Thanks.
 

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