Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Adding cells with specific colors
*I have created a table full of numbers ranging several rows and columns (eg A1:A10), I would like to add up in an adjacent cell all those numbers that I have highlighted in yellow (i.e. whose cell I have changed the background to yellow). Ideally, I would like to be able to change which of these numbers is highlighted and the adjacent cell to change its sum respectively. I am an intermediate in Excel and beginner in VBA so please go slow :) I would appreciate any ideas. Thank you!!* ;) -- spanishjon ------------------------------------------------------------------------ spanishjon's Profile: http://www.excelforum.com/member.php...o&userid=25491 View this thread: http://www.excelforum.com/showthread...hreadid=389391 |
#2
|
|||
|
|||
Jon,
Using color is great. But there just aren't tools to act on it. Take a look at "Formatting as data" at http://smokeylake.com/excel/excel_truths.htm. You might see it'll be a good idea to get away from using color directly. -- Earl Kiosterud www.smokeylake.com "spanishjon" wrote in message ... *I have created a table full of numbers ranging several rows and columns (eg A1:A10), I would like to add up in an adjacent cell all those numbers that I have highlighted in yellow (i.e. whose cell I have changed the background to yellow). Ideally, I would like to be able to change which of these numbers is highlighted and the adjacent cell to change its sum respectively. I am an intermediate in Excel and beginner in VBA so please go slow :) I would appreciate any ideas. Thank you!!* ;) -- spanishjon ------------------------------------------------------------------------ spanishjon's Profile: http://www.excelforum.com/member.php...o&userid=25491 View this thread: http://www.excelforum.com/showthread...hreadid=389391 |
#3
|
|||
|
|||
Hi Jon,
Give this a try. Name your cells DataY and run this macro. It will sum the value of the yellow cells and display the total in F1 and in a message box. Note: The cells color cannot be the result of conditional formatting. Sub SumColorCountYellow() Dim Yellow6 As Integer Dim Cell As Range For Each Cell In Range("DataY") If Cell.Interior.ColorIndex = 6 Then Yellow6 = Yellow6 + Cell.Value End If Next Range("F1").Value = "Yellow = " & Yellow6 MsgBox " Yellow adds to " & Yellow6, _ vbOKOnly, "CountColor" Range("F1").Value = "" End Sub HTH Regards, Howard "spanishjon" wrote in message ... *I have created a table full of numbers ranging several rows and columns (eg A1:A10), I would like to add up in an adjacent cell all those numbers that I have highlighted in yellow (i.e. whose cell I have changed the background to yellow). Ideally, I would like to be able to change which of these numbers is highlighted and the adjacent cell to change its sum respectively. I am an intermediate in Excel and beginner in VBA so please go slow :) I would appreciate any ideas. Thank you!!* ;) -- spanishjon ------------------------------------------------------------------------ spanishjon's Profile: http://www.excelforum.com/member.php...o&userid=25491 View this thread: http://www.excelforum.com/showthread...hreadid=389391 |
#4
|
|||
|
|||
Thank you for the macro Howard, it really helped me. Exactly what Iwas looking for! -- spanishjon ------------------------------------------------------------------------ spanishjon's Profile: http://www.excelforum.com/member.php...o&userid=25491 View this thread: http://www.excelforum.com/showthread...hreadid=389391 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want to select excel cells of difference colors and increase th. | Excel Worksheet Functions | |||
Adding colour to a range of cells based on one of the cells v... | Excel Discussion (Misc queries) | |||
Showing zero in specific cells | Excel Discussion (Misc queries) | |||
print specific cells | Excel Discussion (Misc queries) | |||
EXCEL cells colors | Excel Discussion (Misc queries) |