Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Can I create a Custom Colour?

Hello, I need to colour a cell using VBA but the standard color index
property only gives me 1 shade of yellow to choose from, is there anyway I
can use a spare color index property and make that the color I need somehow?
or any other way?

Thanks
Brian
Manchester, England
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I create a Custom Colour?


"Co-op Bank" ha scritto nel messaggio
...
Hello, I need to colour a cell using VBA but the standard color index
property only gives me 1 shade of yellow to choose from, is there anyway I
can use a spare color index property and make that the color I need
somehow?
or any other way?

Thanks
Brian
Manchester, England


If using RGB color?
For example: ActiveCell.Interior.Color = RGB(0, 0, 255)

Thunder


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can I create a Custom Colour?

If using RGB color?
For example: ActiveCell.Interior.Color = RGB(0, 0, 255)


Note that Excel supports only 56 colors, although you can specify
which 56 colors are used. If you attempt to use a color that is
not in Excel's palette of colors, Excel will use the closest
match. To use a specific color with RGB, you should set one of
the colors in the palette to that color, then use ColorIndex to
get the color to the cell. E.g,

ThisWorkbook.Colors(56) = RGB(r,g,b)
ActiveCell.Interior.ColorIndex = 56

See www.cpearson.com/excel/colors.htm for more info about working
with colors.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Thunder" wrote in message
...

"Co-op Bank" ha scritto
nel messaggio
...
Hello, I need to colour a cell using VBA but the standard
color index
property only gives me 1 shade of yellow to choose from, is
there anyway I
can use a spare color index property and make that the color I
need somehow?
or any other way?

Thanks
Brian
Manchester, England


If using RGB color?
For example: ActiveCell.Interior.Color = RGB(0, 0, 255)

Thunder



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Can I create a Custom Colour?

Hi Brian,

You can customise any of your 56 palette colours

manually - Tools / Options / Color

vba -
ActiveWorkbook.Colors(40) = RGB(255, 255, 220) 'very pale yellow

The customised palette is saved with the Workbook.

With respect to the adjacent suggestion, applying an RGB color to format a
cell results in Excel finding the nearest matching colour in the existing
palette, then applying that colorindex.

Regards,
Peter T


"Co-op Bank" wrote in message
...
Hello, I need to colour a cell using VBA but the standard color index
property only gives me 1 shade of yellow to choose from, is there anyway I
can use a spare color index property and make that the color I need

somehow?
or any other way?

Thanks
Brian
Manchester, England



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
Adding custom colour palette in excel Stumped Excel Discussion (Misc queries) 1 June 3rd 09 02:04 AM
help! custom colour palette in excel 2007 Nikki Excel Discussion (Misc queries) 0 August 14th 07 11:02 AM
How do I create a drop down cell menu with different colour cells Alistair22 Excel Worksheet Functions 1 August 8th 07 05:50 PM
how to create a if statement, if true turn colour Yashes Excel Worksheet Functions 3 October 24th 06 11:12 PM
Custom Colour palette R.T Excel Discussion (Misc queries) 3 October 12th 05 10:39 PM


All times are GMT +1. The time now is 09:41 PM.

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"