View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Comparing Fill Color

Enter this small UDF:

Function clr(R As Range) As Integer
With R.Interior
clr = .ColorIndex
End With
End Function

Use it like =clr(A1). It will return a number corresponding to the
interior color of A1
--
Gary''s Student


"magoobee" wrote:


Is there a way for me to determine the current fill color of a cell?

For example if the cell is red filled, I do not want to change the
color. But if it is any other color, I would would overlay with a
color.

I'm using VBA to comparing 2 fields values and then color filling
another based on the result. The code works fine but I do not want RED
fill to be overlaid.


--
magoobee
------------------------------------------------------------------------
magoobee's Profile: http://www.excelforum.com/member.php...o&userid=21581
View this thread: http://www.excelforum.com/showthread...hreadid=478811