Re: custom cell color
- From: "John Coleman" <jcoleman@xxxxxxxxxxxxxx>
- Date: 30 Nov 2006 10:55:53 -0800
Hi
The only problem with this approach is that Excel treats RGB as a
request which it is able to satisfy in only 56 ways.
Try:
Sub Hmm()
Dim R As Long, G As Long, B As Long
R = 153
G = 204
B = 255
Range("A1").Interior.Color = RGB(R, G, B) 'Colorindex 37
MsgBox RGB(R, G, B) & " vs. " & Range("A1").Interior.Color
R = 154
G = 205
B = 254
MsgBox RGB(R, G, B) & " vs. " & Range("A1").Interior.Color
End Sub
You'll see that the 2 numbers are the same in the first message box but
differ in the second. If you want it to satisfy a custom request you
have to teach it how to by modifying its palette.
-John Coleman
RichardSchollar wrote:
Mark
Range("A1").Interior.Color = RGB(255,0,0)
adjust RGB value to suit.
Best regards
Richard
--
RichardSchollar
------------------------------------------------------------------------
RichardSchollar's Profile: http://www.officehelp.in/member.php?userid=5248
View this thread: http://www.officehelp.in/showthread.php?t=1275010
Posted from - http://www.officehelp.in
.
- Follow-Ups:
- Re: custom cell color
- From: John Coleman
- Re: custom cell color
- References:
- custom cell color
- From: mark kubicki
- Re: custom cell color
- From: RichardSchollar
- custom cell color
- Prev by Date: Re: Create Tabs from Existing Tab
- Next by Date: RE: Conditional formating
- Previous by thread: Re: custom cell color
- Next by thread: Re: custom cell color
- Index(es):
Relevant Pages
|