Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formating - dynamic data bar colors Sirpent0r Excel Discussion (Misc queries) 10 May 17th 23 07:45 PM
Used drawing colors in shapes....lost default colors for "Fill Col Lai704 Excel Discussion (Misc queries) 1 August 20th 08 04:45 AM
Lost highlighting and font colors; background colors on web pages Jan in Raleigh Excel Discussion (Misc queries) 2 July 31st 07 09:10 PM
question regarding dynamic cell colors [email protected] Excel Programming 4 March 16th 06 06:38 PM
Code to change interior colour only if current interior colour is BeSmart Excel Programming 2 October 5th 04 12:06 AM


All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"