LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Color constants in VBA



keepITcool wrote:

Mark Tangard wrote in :


Hm. Actually it still doesn't come up in my VBA Help (XL 2000)....

These do work; but I was hoping to find the constants for all 40 of
the colors that can be applied to a cell interior from the toolbar
dropdown. Are these not all available as VBA constants?



Dont get confused between VBA color constants
and EXCEL COLORINDEX and COLORS properties

When you speak of 40 colors you're referring to the COLORINDEX

each workbook has a property called COLORS.
this is in fact an 1x56 array of doubles representing RGB values.

the colorindex is a pointer to an element in the COLORS array.

note hex representation is BRG not RGB..
activecell.Interior.Color=&Hff0000 '<= BLUE 255,Green0,Red0
?activecell.Interior.ColorIndex
5

dim ci,co
co=activeworkbook.colors
for each ci in co
debug.print ci, hex(ci)
next


hth


OK, thanks, that clarifies. It's a shame they're not available in
text-mnemonic constants, as in Word. Guess I'll be doing a lot of
memorizing....

MT

 
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
Array Constants kittronald Excel Worksheet Functions 0 June 15th 11 12:04 AM
Constants in Excel Sharon Excel Discussion (Misc queries) 0 July 24th 08 02:38 PM
How to get a dump of Fill Color & Font VBA Constants? EagleOne Excel Discussion (Misc queries) 3 August 17th 06 08:17 PM
vba constants for excel diver Excel Discussion (Misc queries) 2 August 25th 05 07:51 PM
constants Confused Excel Discussion (Misc queries) 3 December 2nd 04 05:05 PM


All times are GMT +1. The time now is 04:52 PM.

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

About Us

"It's about Microsoft Excel"