Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
themecolor, colorindex, color picker | Excel Programming | |||
Color vs Colorindex for series border | Charts and Charting in Excel | |||
tab.colorindex linked to cell color | Excel Worksheet Functions | |||
ColorIndex returns incorrect color | Excel Programming | |||
Name of color for a particular colorindex number | Excel Programming |