ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional formats (https://www.excelbanter.com/excel-programming/407429-conditional-formats.html)

Sandy

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




All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com