Conditional formats

S

Sandy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top