Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
spanishjon
 
Posts: n/a
Default 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   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

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   Report Post  
L. Howard Kittle
 
Posts: n/a
Default

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   Report Post  
spanishjon
 
Posts: n/a
Default


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
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
I want to select excel cells of difference colors and increase th. Wilbanks Excel Worksheet Functions 1 March 31st 05 01:32 AM
Adding colour to a range of cells based on one of the cells v... McKenna Excel Discussion (Misc queries) 4 March 11th 05 02:25 PM
Showing zero in specific cells Swingbridge. Excel Discussion (Misc queries) 2 February 12th 05 04:56 AM
print specific cells Wendy Excel Discussion (Misc queries) 1 February 10th 05 06:52 PM
EXCEL cells colors bernard Excel Discussion (Misc queries) 1 December 19th 04 11:36 AM


All times are GMT +1. The time now is 12:34 PM.

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"