ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why cell colors change when copying/moving (https://www.excelbanter.com/excel-programming/315945-why-cell-colors-change-when-copying-moving.html)

kdw

Why cell colors change when copying/moving
 
I have a sheet with data where the headers are colored gray and a few other
cells highlighted. I am using VB to make a copy of this sheet into a new
workbook, but all the colors change to an awful bright green and red in the
new sheet. Why is this? I am only doing a straight copy ( or move) of the
new sheet.

I tried doing the copy manually (i.e. Copy, Paste.). Same thing happened.
But the colors are fine when I copy it into another sheet _within_ the
original workbbok.

Is there something wrong with the original sheet to cause this to happen?

Thanks for any insight you all might have, as this is driving me nuts.

keepITcool

Why cell colors change when copying/moving
 

colors can be set per workbook...

Probably the sheet's designer used the colorindexes of basic
colors "Magenta" and "Yellow" and assigned them custom
RGB values..

Via Tools/Options Color you can import the colortable from the original
workbook into the new.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?a2R3?= wrote in message
:

I have a sheet with data where the headers are colored gray and a few
other cells highlighted. I am using VB to make a copy of this sheet
into a new workbook, but all the colors change to an awful bright
green and red in the new sheet. Why is this? I am only doing a
straight copy ( or move) of the new sheet.

I tried doing the copy manually (i.e. Copy, Paste.). Same thing
happened. But the colors are fine when I copy it into another sheet
_within_ the original workbbok.

Is there something wrong with the original sheet to cause this to
happen?

Thanks for any insight you all might have, as this is driving me nuts.



kdw

Why cell colors change when copying/moving
 
I was able to set newworkbook.colors=oldworkbook.colors.
It worked great! This certainly made my week. Thanks for the hint.

But I suppose if anyone else try to make a copy of the new sheet I created,
they would run into the same problem. Is there anyway to convert the colors
over permanently?


"keepITcool" wrote:


colors can be set per workbook...

Probably the sheet's designer used the colorindexes of basic
colors "Magenta" and "Yellow" and assigned them custom
RGB values..

Via Tools/Options Color you can import the colortable from the original
workbook into the new.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?a2R3?= wrote in message
:

I have a sheet with data where the headers are colored gray and a few
other cells highlighted. I am using VB to make a copy of this sheet
into a new workbook, but all the colors change to an awful bright
green and red in the new sheet. Why is this? I am only doing a
straight copy ( or move) of the new sheet.

I tried doing the copy manually (i.e. Copy, Paste.). Same thing
happened. But the colors are fine when I copy it into another sheet
_within_ the original workbbok.

Is there something wrong with the original sheet to cause this to
happen?

Thanks for any insight you all might have, as this is driving me nuts.




keepITcool

Why cell colors change when copying/moving
 
nope.

except you could:
find "compatible" colors in the standard colorset,
reset the workbooks colors to standard and 'recolor'
the cells to the new colorindex.
(which you could do with a relatively simple macro)

Fill an array or collection with the "colormapping"
then loop thru all cells where the colorindex < xlnone
and reassign.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?a2R3?= wrote in message
:

I was able to set newworkbook.colors=oldworkbook.colors.
It worked great! This certainly made my week. Thanks for the hint.

But I suppose if anyone else try to make a copy of the new sheet I
created, they would run into the same problem. Is there anyway to
convert the colors over permanently?


"keepITcool" wrote:


colors can be set per workbook...

Probably the sheet's designer used the colorindexes of basic
colors "Magenta" and "Yellow" and assigned them custom
RGB values..

Via Tools/Options Color you can import the colortable from the
original workbook into the new.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?a2R3?= wrote in message
:

I have a sheet with data where the headers are colored gray and a
few other cells highlighted. I am using VB to make a copy of this
sheet into a new workbook, but all the colors change to an awful
bright green and red in the new sheet. Why is this? I am only
doing a straight copy ( or move) of the new sheet.

I tried doing the copy manually (i.e. Copy, Paste.). Same thing
happened. But the colors are fine when I copy it into another sheet
_within_ the original workbbok.

Is there something wrong with the original sheet to cause this to
happen?

Thanks for any insight you all might have, as this is driving me
nuts.







All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com