View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Sandy is offline
external usenet poster
 
Posts: 156
Default Sum Cells with colors

Try playing around with this to get you started:

Sub ColorSum()
Dim mYellow, mGreen, mRed As Double
Dim mCell As Range
For Each mCell In Range("A1:A5")
If mCell.Interior.ColorIndex = 10 Then
[A7].Value = [A7].Value + mCell.Value
ElseIf mCell.Interior.ColorIndex = 6 Then
[A8].Value = [A8].Value + mCell.Value
ElseIf mCell.Interior.ColorIndex = 3 Then
[A9].Value = [A9].Value + mCell.Value
End If
Next
End Sub




Sandy

willwonka wrote:
You can create a custom function using Chuck Pearson's website:

http://www.cpearson.com/excel/colors.htm

Or

I believe the new ASAP Utilities has a function for this.

http://www.asap-utilities.com/


taxmom wrote:
What formula can I use to sum at the bottom of the pages specific colors?

ex.

5.00 yellow
2.00 green
1.00 yellow
1.00 red
3.00 green

total green 5.00
Total Yellow 6.00
Total Red 1.00

Is this possible?

Thank you ! You are all so helpful.