Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default adding colored cells only

I am wanting to add specifice colored cells only on my worksheet, the colors
represent stages that different orders are in and would like to keep a
running dollar amount total in each stage - maybe a conditional format? I
don't know how to tell excel to add only a certain color of cell - is it
possible without buying an additional program?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default adding colored cells only

You need code for this

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


info on how to install macros and UDFs

http://www.mvps.org/dmcritchie/excel/install.htm

--


Regards,


Peo Sjoblom

"lindateammom" wrote in message
...
I am wanting to add specifice colored cells only on my worksheet, the
colors
represent stages that different orders are in and would like to keep a
running dollar amount total in each stage - maybe a conditional format? I
don't know how to tell excel to add only a certain color of cell - is it
possible without buying an additional program?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default adding colored cells only

Hi,

If the colours are as a result of a conditional format then naybe it coud be
done with a formula but more detail qould be required. If the colours are
simply fill colours then you need a UDF and the one below does that

http://www.ozgrid.com/Excel/count-sum-cell-color.htm

Mike

"lindateammom" wrote:

I am wanting to add specifice colored cells only on my worksheet, the colors
represent stages that different orders are in and would like to keep a
running dollar amount total in each stage - maybe a conditional format? I
don't know how to tell excel to add only a certain color of cell - is it
possible without buying an additional program?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default adding colored cells only

Hi,

You must use VBA, here is some code you could modify:

Function SumFormats(R As Range, E As Range) As Integer
Dim cell As Range
Dim Total As Integer
Dim T As Boolean
Set S = E.Cells(1, 1)
Total = 0
For Each cell In R
T = True
With cell
If .Font.ColorIndex < S.Font.ColorIndex Then T = False
If .Interior.ColorIndex < S.Interior.ColorIndex Then T = False
If .Font.Bold < S.Font.Bold Then T = False
If .Font.Italic < S.Font.Italic Then T = False
If .Font.Underline < S.Font.Underline Then T = False
End With
If T = True Then
Total = Total + cell
End If
Next cell
CountFormats = Total
End Function

If you are only interested in the background color take out the 4 lines for
Font.

This creates a custom function, which you use by typing a formula such as
this in the spreadsheet:

=SumFormats(A1:F13,H1)

This formula would check the format of H1 and sum all the cells in the range
A1:F13 which had the same color format.
--
Thanks,
Shane Devenshire


"lindateammom" wrote:

I am wanting to add specifice colored cells only on my worksheet, the colors
represent stages that different orders are in and would like to keep a
running dollar amount total in each stage - maybe a conditional format? I
don't know how to tell excel to add only a certain color of cell - is it
possible without buying an additional program?

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
Colored and filtered cells Tony S.[_2_] New Users to Excel 4 January 9th 08 11:53 PM
sum colored cells AOP Excel Discussion (Misc queries) 4 November 8th 07 07:25 PM
Adding sums only in certain colored cells vkauahi Excel Worksheet Functions 6 January 5th 07 11:27 PM
Vlookup using Colored Cells Ananth Excel Discussion (Misc queries) 3 October 22nd 06 04:31 PM
Select only colored cells BBlue Excel Worksheet Functions 2 March 23rd 06 09:15 PM


All times are GMT +1. The time now is 12:28 AM.

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

About Us

"It's about Microsoft Excel"