fill a cell with RGB code

cmendes

Board Regular
Joined
Jan 24, 2011
Messages
66
Hello everyone,

Is it possible to have a set of three cells with the code for RGB followed by the corresponding color? Is there a formula for this?
For example have 238 then 113 then 25= orange cell
Thanks
C
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
hmmm...no....
i had the R G and B values on A1 B1 and C1 and I copy/pasted the formula you gave me on D1 and I only got the text of the formula...
 
Upvote 0
That's VBA code. Here's a quick example how you can use it:

To add this code, hit Alt+F11, double click on Sheet1, and copy/paste it into the editor.

Private Sub Worksheet_Change(ByVal Target As Range)
Range("D1").Interior.Color = RGB(Range("A1"), Range("B1"), Range("C1"))
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,841
Members
452,948
Latest member
UsmanAli786

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
Back
Top