View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default COUNT HIGHLIGHTED CELLS IN A ROW ?

Hi,

You can do it with a UDF. Alt + F11 to open VB editor. Right click 'This
Workbook' and insert module and paste this in

Function SumColours(sumrange As range, colour As Long)
For Each c In sumrange
If c.Interior.ColorIndex = colour And IsNumeric(c) Then
mytot = mytot + c
End If
Next
SumColours = mytot
End Function

On the worksheet call with
=sumcolours(A1:A100,3)

Where A1:A100 is the range to sum
3 is the colour (Red)

If you dont know the colour numbers record a macro of colouring cells


Mike


"Stephen the computer dummy" wrote:

I would like figure out how to add highlighted cells in a row with a
designated cell for the sum. If anyone can help it would make my spreadsheet
much more effective and easier to manage.
Thanks
topcat