Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default adding coloured cells together

I have been forwarded a spreadsheet where the cells have been filled with
colour.
The colours represent certain activities.

Is there any way I can add together all the values in the red cells, and all
the values in the green cells?

regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default adding coloured cells together

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TheRook" wrote in message
...
I have been forwarded a spreadsheet where the cells have been filled with
colour.
The colours represent certain activities.

Is there any way I can add together all the values in the red cells, and

all
the values in the green cells?

regards



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default adding coloured cells together

Link doesnt work!

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TheRook" wrote in message
...
I have been forwarded a spreadsheet where the cells have been filled with
colour.
The colours represent certain activities.

Is there any way I can add together all the values in the red cells, and

all
the values in the green cells?

regards




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default adding coloured cells together

In a general module (insert=Module in the VBE), put in a function like:

Public Function countcoloredCells(rng as range, lcolor as Long)
Dim cnt as Long
Dim cell as Range
for each cell in rng
if cell.interior.colorIndex =lcolor then
cnt = cnt + 1
end if
Next
countcoloredcells = cnt
End Function

red would be 3
Green would be 4

although there are some shades of these colors that could have a differnt
colorindex.

Select a sample cell and run this

sub showcolorIndex()
msgbox "Color index is " & activecell.interior.colorindex
End sub

usage
=countcoloredcells(A1:A100,3)

--
Regards,
Tom Ogilvy


"TheRook" wrote:

Link doesnt work!

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TheRook" wrote in message
...
I have been forwarded a spreadsheet where the cells have been filled with
colour.
The colours represent certain activities.

Is there any way I can add together all the values in the red cells, and

all
the values in the green cells?

regards




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default adding coloured cells together

It most certainly does!

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TheRook" wrote in message
...
Link doesnt work!

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TheRook" wrote in message
...
I have been forwarded a spreadsheet where the cells have been filled

with
colour.
The colours represent certain activities.

Is there any way I can add together all the values in the red cells,

and
all
the values in the green cells?

regards






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coloured Cells The Message Excel Discussion (Misc queries) 8 December 2nd 09 04:44 PM
Adding sum of coloured cells The Rook[_2_] Excel Discussion (Misc queries) 1 November 17th 08 11:31 AM
adding values in coloured cells lois Excel Discussion (Misc queries) 2 November 5th 07 04:32 PM
Adding data to coloured cells Paul Sheppard Excel Discussion (Misc queries) 1 June 29th 06 09:16 AM
Coloured Cells Becks Excel Discussion (Misc queries) 3 February 8th 06 12:46 PM


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"