Cell fill color

drltr6

New member
Joined
Oct 25, 2011
Messages
22
Reaction score
0
Points
0
Excel Version(s)
MAC 2011
I want to have a UDF that will look at a cell background color (which is filled in by the user), and then return a capital letter to reference that cell color. For example: The user fills a cell with a blue fill. I want a "B" to show in a designated cell. I know how to do it with the RGB values, but I need a generic answer. Any blue fill will produce a "B", any red fill will produce an "R". etc. Is this possible?

Thanks in advance for any help offered.
 
Here is the UDF that I have now:
Function CheckColor1(Range) If Range.Interior.Color = RGB(256, 0, 0) Then
CheckColor1 = "S"
ElseIf Range.Interior.Color = RGB(0, 255, 255) Then
CheckColor1 = "B"
Else
CheckColor1 = "G"
End If
End Function

This uses exact RGB color code
 
Back
Top