Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic interior colors
This is probably a simple answer, but I cannot see it.
I have four cells, A1, B1, C1 and D1. What I would like to do is to have a funtion so that when values are entered into A1(Red), B1(Green), and C1(Blue), the interior color of D1 would correspond to the RGB values entered. Is there such a beast where I could type into cell D1, =RGB(A1, B1, C1) ? If not how would I go about creating such a function? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic interior colors
Since it's only 3 conditions, you could use conditional formatting from
Format-Conditional Formatting. "RobL" wrote in message ... This is probably a simple answer, but I cannot see it. I have four cells, A1, B1, C1 and D1. What I would like to do is to have a funtion so that when values are entered into A1(Red), B1(Green), and C1(Blue), the interior color of D1 would correspond to the RGB values entered. Is there such a beast where I could type into cell D1, =RGB(A1, B1, C1) ? If not how would I go about creating such a function? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic interior colors
Cell D1 will display the rgb color if you enter integers in A1, B1, C1. Place this code in the Sheet module... '-- Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not Intersect(Target(1, 1), Me.Range("A1:C1")) Is Nothing Then Dim N As Long For N = 1 To 3 If Not IsNumeric(Me.Cells(1, N)) Then Exit Sub Next Me.Parent.Colors(54) = _ RGB(Me.Range("A1").Value, Me.Range("B1").Value, Me.Range("C1").Value) Me.Range("D1").Interior.ColorIndex = 54 End If End Sub '-- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "RobL" wrote in message This is probably a simple answer, but I cannot see it. I have four cells, A1, B1, C1 and D1. What I would like to do is to have a funtion so that when values are entered into A1(Red), B1(Green), and C1(Blue), the interior color of D1 would correspond to the RGB values entered. Is there such a beast where I could type into cell D1, =RGB(A1, B1, C1) ? If not how would I go about creating such a function? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Formating - dynamic data bar colors | Excel Discussion (Misc queries) | |||
Used drawing colors in shapes....lost default colors for "Fill Col | Excel Discussion (Misc queries) | |||
Lost highlighting and font colors; background colors on web pages | Excel Discussion (Misc queries) | |||
question regarding dynamic cell colors | Excel Programming | |||
Code to change interior colour only if current interior colour is | Excel Programming |