View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dominique Feteau Dominique Feteau is offline
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