• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

UDF to find RGB Value of a color

If you want to know the RGB Value of a Fill color . Try this UDF

[pre]
Code:
Function rgb_color(cl As Range) As String
Dim rgbc As Long, rc As Long, gc As Long, bc As Long
If cl.Cells.Count = 1 Then
rc = cl.Interior.Color Mod 256
rgbc = Int(cl.Interior.Color / 256)
gc = rgbc Mod 256
bc = Int(rgbc / 256)
rgb_color = "Red - " & rc & " Green - " & gc & " Blue - " & bc
Else
rgb_color = "Please select single cell only"
End If
End Function
[/pre]
 
Back
Top