Color Codes: Different color with same color Index

  • Thread starter Michiel via OfficeKB.com
  • Start date
M

Michiel via OfficeKB.com

Can Anyone shine a light on this:

I have a worksheet and did this:
activecell.Interior.ColorIndex =40
The cell became salmon orange as I would expect it.

I received another version of the same spreadsheet saved by a colleague.
All the cells that are salmon-orange in my sheet turn out to be grey in his
sheet.
When I select a grey cell and run:
?activecell.Interior.ColorIndex
again 40 is returned.
Even if I once more run
activecell.Interior.ColorIndex =40
the cell stays grey.

So, I have two sheets, both with cells that have an interior.colorindex of 40
but they show different colors.

Additional:
When I go to the Fill Color or Font Color icon in my colleagues sheet and hit
the arrow I get a palette that again differs from the palette I get in my own
sheet.

Is there some parameter that controls the general look of the palette and the
connected behavior of the color index coding?

Thanks!

Michiel
 
R

Ryan H

The .ColorIndex property refers to colors "indexed" in the Color Palette.
That explains why Activecell.Interior.ColorIndex = 40, gives you two
different colors, because you have two different Color Palette's.

I would try:

' salmon color
ActvieCell.Interior.Color = 10079487

The .Color property uses the RGB function which is universal. Read the Help
Section on ColorIndex and Color. Hope this helps! If so, let me know, click
"YES" below.
 
M

Michiel via OfficeKB.com

Hi Ryan H.,

GREAT! Your information was very helpful!

Unfortunately the suggestion to use:
ActiveCell.Interior.Color = 10079487
did not work either. (It resulted in a yellow cell.)

But on reading your link I solved the issue by applying:
ActiveWorkbook.ResetColors
first.

Thanks!

M.


Ryan said:
Forgot about the other question. Take a look at this link from Microsoft on
changing the Color Palette.

http://office.microsoft.com/en-us/excel/HP051989351033.aspx
Can Anyone shine a light on this:
[quoted text clipped - 26 lines]
 

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

Top