View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 270
Default Conditional formats

I have a situation where given certain criteria conditional formats are set.
One in particular sets the background colour of cells to Light Yellow
(Interior.ColorIndex = 36). What I would like to do is the following :-

Function YellowBack(MyRange As Range)

Dim MyCell As Range
YellowBack = False

For Each MyCell In MyRange
If MyCell ***(has conditional format with Light Yellow
background)*** Then
YellowBack = True
Exit Function
End If
Next MyCell

End Function

I have tried the "If" line :-
"If MyCell.Interior.ColorIndex = 36 Then"
but the conditionally formatted colour is not being identified - I presume
it is identifying the un- conditionally formatted background colour - if
you see what I mean.

Any help gratefully received.
Sandy