Excel isn't designed to use color in this way. Of
course you probably can find someone to write some
VBA to achieve your objectives, but it's a bad
practice. Care to explain more about the design
of your worksheet, the meaning of the colors, and
your intent?
Hi Terry
Here is a User Difined Function that will add all cells of the same font color.
Function ColorSum(ColorCell As Range, SumRange As Range) As Variant
Dim Cell As Range
For Each Cell In SumRange
If Cell.Font.ColorIndex = ColorCell.Font.ColorIndex Then
ColorSum = Cell + ColorSum
End If
Next
ColorSum = ColorSum
End Function
to use it Push Alt+F11 then go to Insert>Module and paste it in. Now push Alt+Q and save.
Now in any cell put: =ColorSum(C2,C2:C10)
Where C2 contains the font color to sum. And C2:C10 contains the cells to sum of the same font color as C2.
It maybe a bit slow on large ranges, dont be tempted to select an entire Column either.
Hope this helps
Dave
- OzGrid Business Applications
Just like to say that it works and thanks for your help