Get RGB from cell color.

L

Legacy 98055

Guest
This came up with from a reply to:
http://216.92.17.166/board/viewtopic.php?topic=25527&forum=2&3
I usually do a screen capture to Paint Shop Pro to get the RGB, but thought it would be nice to have a function which would get the Red, Green, Blues's from a cell. I could settle for a chart. Have seen them on the net. But I would still like to have this function available if anyone has a clue on how to do it.
Thanks,
Will keep looking myself
Tom
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

NateO

Legend
Joined
Feb 17, 2002
Messages
9,700
Hello Tom, based on some of David McRitchie's fine handy work from:

http://216.239.33.100/search?q=cach...l/colors.htm+"mcritchie"+"rgb"&hl=en&ie=UTF-8

I played with the following with some success in xl2000:

<pre>
Function showRGB2(rcell)
Dim myStr As String
Application.Volatile
myStr = Right("000000" & Hex(rcell.Interior.Color), 6)
showRGB2 = Application.Evaluate("=Hex2dec(""" & Right(myStr, 2) & """)") & _
", " & Application.Evaluate("=Hex2dec(""" & Mid(myStr, 3, 2) & """)") & ", " _
& Application.Evaluate("=Hex2dec(""" & Left(myStr, 2) & """)")
End Function</pre>

Hope this helps.
 

Forum statistics

Threads
1,144,050
Messages
5,722,234
Members
422,417
Latest member
Johhny

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top