formatting background color of a cell with custom colors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How can we set the interior color of a cell with custom colors other than
color index values..like say i wan to set "#ccccff" this as background color
of cell.
 
Hello sprasad,

Range("A1").Interior.Color = RGB( &HCC, &HCC, &HFF)

Sincerely,
Leith Ross
 
That won't work, Excel will map the colour to the nearest colour on the
colour palette.

sprasad,

You will need to define new colours to the colour palette first before you
can use the new colour, such as

ActiveWorkbook.Colors(25) = RGB(&HCC, &HCC, &HFF)


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi,
Thanks for the response. I am trying do that in C#,it works in VB but not
in C# as there is no RGB available.I tried to use
System.Drawing.Color.fromArgb() but its giving type mismatch

Bob Phillips said:
That won't work, Excel will map the colour to the nearest colour on the
colour palette.

sprasad,

You will need to define new colours to the colour palette first before you
can use the new colour, such as

ActiveWorkbook.Colors(25) = RGB(&HCC, &HCC, &HFF)


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Sorry, I can't help with C#.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top