Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Value of a cell in a range if color is yellow

I searched the board for the answer to this question and went to
http://www.cpearson.com/excel/colors.htm to see if i could find what i
needed but to no avail. What I need is a function that will look in a
range, (which are months formatted as mmm-yy) and give me the value of that
cell that is yellow. I did get some code, but it comes up as a message box.
I'd rather have it as a formula i can stick in a cell and have it return an
value. so if in the range b12:m12, j12 is yellow, i'd like to have the
value of j12 in a cell.

Sub yellowvalue()
For Each c In [b12:m12]
If c.Interior.ColorIndex = 6 Then MsgBox c
Next
End Sub

Can anyone help me out?

Dominique


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Value of a cell in a range if color is yellow

Yes, I'm the one that gave you the original code. Just modify to:
If c.Interior.ColorIndex = 6 Then MsgBox c

If c.Interior.ColorIndex = 6 Then [a2].value=c
--
Don Guillett
SalesAid Software

"Dominique Feteau" wrote in message
...
I searched the board for the answer to this question and went to
http://www.cpearson.com/excel/colors.htm to see if i could find what i
needed but to no avail. What I need is a function that will look in a
range, (which are months formatted as mmm-yy) and give me the value of

that
cell that is yellow. I did get some code, but it comes up as a message

box.
I'd rather have it as a formula i can stick in a cell and have it return

an
value. so if in the range b12:m12, j12 is yellow, i'd like to have the
value of j12 in a cell.

Sub yellowvalue()
For Each c In [b12:m12]
If c.Interior.ColorIndex = 6 Then MsgBox c
Next
End Sub

Can anyone help me out?

Dominique




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
change the color of yellow tip box on data validation JoaquinBallinasTjMx Excel Discussion (Misc queries) 1 May 6th 09 07:53 PM
Change cell color from yellow to blue Bob Ng Kai Sin Excel Worksheet Functions 3 September 14th 07 11:06 AM
formula for if Cell c1 is yellow shaded cell d1 should be yellow Hardeep Excel Discussion (Misc queries) 1 October 27th 05 02:58 PM
How do you count cells with background color yellow? Stephanie D Excel Discussion (Misc queries) 6 October 18th 05 04:34 AM
How to change the color of the series markers from yellow to Black Sam Charts and Charting in Excel 2 June 30th 05 02:47 PM


All times are GMT +1. The time now is 12:55 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"