View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ker_01 ker_01 is offline
external usenet poster
 
Posts: 395
Default Working with colors (default and custom)

Thanks Patrick!

Since it looks like I'm limited to the colorlist, I'll use your suggestion
to figure out which default colors are which. I was trying to create/pick
colors that aren't on the default list to ensure that the colors used were as
different as possible, but apparently Excel defaults to the nearest colorlist
option- and I want to avoid changing the actual default colorlist.

Best,
Keith

"Patrick Molloy" wrote:

it sounds like you're re-inventing the wheel

this code creates a named range called colorlist with all the available
colors:

Sub CreateColorList()
Dim i As Long
For i = 0 To 56
Cells(i + 1, 1) = i
Cells(i + 1, 2).Interior.ColorIndex = i
Next
Range("A1:B57").Name = "colorlist"
End Sub


to color a cell just use this as a handy guide








"ker_01" wrote:

XL2003 on XP

I'm color coding a range of cells in my worksheet, which I'm then exporting
(in chunks) as EMF files to be uploaded into Visio and paired with specific
shapes as status indicators.

I'm using most of the built-in colors (vb blue, cyan, green, magenta, red,
yellow) but that wasn't enough distinctly colors to cover my target
categories, so I added a few mo

My_vbOrange = RGB(255, 128, 0)
My_vbDarkGreen = RGB(0, 128, 0)
My_vbDrkPurple = RGB(255, 0, 255)
My_vbLtPurple = RGB(90, 90, 255)
My_vbPuke = RGB(128, 128, 0)
My_vbOcean = RGB(64, 128, 128)
My_vbRose = RGB(180, 60, 95)
My_vbBrown = RGB(255, 128, 0)

I then use a select case statement for each value to determine which color
to use as the cell fill.

When I run my code, most of the colors appear to work as expected (orange,
rose, ocean all show up). However, I just noticed that my two purples are not
differentiating on the worksheet- they are both exactly the same color of
pink (same as pink on the color picklist).

My goal was to use colors that were more differentiated than the built in
set, but without actually changing the pallet (in case anyone else uses this
workbook, I don't want to cause other unforeseen problems with them changing
workbook colors and affecting my pallet).

Am I stuck just using the default colorindex pallet set? Also, why are some
of my colors working and not others?

Thanks,
Keith