Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Counting shaded cells

1 view
Skip to first unread message

Sam

unread,
Aug 29, 2000, 3:00:00 AM8/29/00
to

In a total row (let's say row 20), I would like to sum the number of cells I
have shaded in each column. Is there a formula or VBA I can use?

David McRitchie

unread,
Aug 29, 2000, 3:00:00 AM8/29/00
to

Hi Sam,
Count the cells with same interior color as A$3
=countbycolor(A$1:A$17,cellcolorindex(A$3,0))

using the function by that name in
Chip Pearson's "Functions For Cell Colors"
http://www.cpearson.com/excel/colors.htm

since you say shaded, presume you mean shading,
so change colorindex to pattern and
rename your new function accordingly.

Recording a macro is where you can pick up some
details such as I just gave you to use .pattern
instead of colorindex

Colors work best using the color of another cell,
with a pattern you could specifically use the name
i.e. xlgray8, xlgrid, xlvertical
if that is easier.

HTH,
David McRitchie, Microsoft MVP - Excel (site changed 2000-04-15)
My Excel Macros: http://www.geocities.com/davemcritchie/excel/excel.htm

Sam <hend...@hotmail.com> wrote ...

0 new messages