Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting number of cells based on color 1

Status
Not open for further replies.

LGMan

MIS
Aug 27, 2003
233
GB
Hi apologies if this has been asked before, however...
is it possible to show a count of cells according to color.
By this I mean if there is a single row with 10 columns (so 10 cells) if 3 of them are green (colorIndex=4), can I show the number 3 in a free cell?

 


Hi,

Short answer: NO.

You did not say whether it is the cell INTERIOR or cell FONT colorindex.

Regardless, are you using Conditional Formatting to control the color? If so, you can use the sam logic to effect an aggregation.

If not, it will take VBA code to loop thru each cell in a range, determine the colorindex and aggregate accordingly.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
FYI:
Using Office Excel 2007, you can sort and filter by format, including cell color and font color, whether you have manually or conditionally formatted the cells.
 
Please check FAQs before posting:

faq707-6049

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff,
Although I've found a simpler way around my problem, your FAQ is something that will prove very useful for another time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top