View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default ColorIndex vs Color?

The conditional colors will appear in the cell, but the cell's color index
will reflect the color disregarding any conditional formatting.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Jim Cone" wrote in message
...

Also, Conditional Formatted colors will override any normal color
formatting.
--
Jim Cone
Portland, Oregon USA




"Josh Sale"
wrote in message
I have what I think should be a very simple problem but I can't quite
puzzle
it out. Basically I want to copy the background color from one arbitrary
cell to another arbitrary cell. I want this process to work even if the
user has formatted the source cell using a color from a custom color
palette.
I currently have code that looks more or less like this:

If SourceRange.ColorIndex < xlNone Then
TargetRange.Interior.ColorIndex = SourceRange.ColorIndex
TargetRange.Interior.Color = SourceRange.Color
End If

Mostly this seems to work OK. However sometimes it fails (that is the
wrong
background color appears). I think in these cases it because the source
range has a custom background color.
Source and Target are always in different workbooks so I have a line like
this in my code:
TargetRange.Parent.Parent.Colors = SourceRange.Parent.Parent.Colors
to try to copy the custom color palette from the source workbook into the
target workbook.
I have to admit I'm fuzzy on difference between the Color and ColorIndex
properties. I gather the former is an rgb value and the latter is an
index
into the palette. Do I need to copy both to get my colors? One? Which
one?
TIA
josh