Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sum based on font color

Is there a function which can sum up all the cells in a column where the
contents of the cell are in pink color.

Pls help.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Sum based on font color

something along these lines to get you started:

Option Explicit
Enum eColor
Pink = 13408767
End Enum
Function ColorSum(Source As Range) As Double
Dim total As Double
Dim cell As Range
For Each cell In Source
With cell
If .Font.Color = eColor.Pink Then
total = total + .Value
End If
End With
Next
ColorSum = total
End Function


Enhancements:
1) see if you can make the color a parameter
2) add a check to ensure that a cell has a legitimate value befor totalling

works as is though.


"mario" wrote:

Is there a function which can sum up all the cells in a column where the
contents of the cell are in pink color.

Pls help.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sum based on font color

See http://www.xldynamic.com/source/xld.ColourCounter.html

--

HTH

RP
(remove nothere from the email address if mailing direct)


"mario" wrote in message
...
Is there a function which can sum up all the cells in a column where the
contents of the cell are in pink color.

Pls help.

Thanks



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
More Functions based on Font Color michelle New Users to Excel 2 September 3rd 08 08:56 PM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
change font color based on a value Golf Nut[_2_] Excel Worksheet Functions 1 April 26th 07 03:30 PM
How do you change font color based on the value input? 1 = . mojeta Excel Discussion (Misc queries) 1 July 15th 05 07:17 PM
Sum a row of data based on FONT COLOR ( RockNRoll[_2_] Excel Programming 2 June 24th 04 09:36 PM


All times are GMT +1. The time now is 06:07 PM.

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"