colors changing magically

S

samearle

I've worksheets where I've made custom colors.

Sometimes, when I email them, open them on different computers, or even
just open them on my computer after working with other .xls files, the
custom color has reverted to it's origional color or something
completely new.

I'm wondering how I make a custom color stay what I made it be under:

tools -> option -> color -> (select color) -> modify -> custom -> RGB

and not have it change to something new or the origional standard
color.

Thanks,

Sam
 
B

Bernie Deitrick

Sam,

You could use code in the workbook open event to set the workbook's colors:

ThisWorkbook.Colors(1) = RGB(red,green,blue)
ThisWorkbook.Colors(2) = RGB(red,green,blue)
....
ThisWorkbook.Colors(55) = RGB(red,green,blue)
ThisWorkbook.Colors(56) = RGB(red,green,blue)

Excel is limited to whatever 56 colors are in the pallet, but those colors can
be any RGB colors.

HTH,
Bernie
MS Excel MVP
 
S

samearle

Thanks Bernie, Thats an idea.

Do you know if I could change that for all templates company wide?
Ergo, when someone opens a doc company wide, the colors are set?

Thanks,

S.
 
S

samearle

How do I add the below???

I opened a new excel doc, went to tools - visuall basic editor. Then
added the following to module1:

ThisWorkbook.Colors(1) = RGB(100, 200, 200)
ThisWorkbook.Colors(2) = RGB(100, 200, 200)
ThisWorkbook.Colors(55) = RGB(100, 200, 200)
ThisWorkbook.Colors(56) = RGB(100, 200, 200)

basically, what I am trying to do is change collors to custom colors
every time the document opens.

Thanks,

Sam
 
D

Dave Peterson

You could create a subroutine in a General module named Auto_Open and it would
run each time excel opens that workbook:

Option Explicit
Sub Auto_Open()
ThisWorkbook.Colors(1) = RGB(100, 200, 200)
ThisWorkbook.Colors(2) = RGB(100, 200, 200)
ThisWorkbook.Colors(55) = RGB(100, 200, 200)
ThisWorkbook.Colors(56) = RGB(100, 200, 200)
end sub

But unless someone/something is changing the colors, you should only have to run
this kind of code once.
 
S

samearle

Problem is, colors change when the document gets sent to a new
computer. Esspecially when it gets sent to london from the US.

Any thoughts?

Thanks for the help.

S.
 
D

Dave Peterson

Colors should travel to with the workbook. There's something else happening.

But since you have another response at your other thread, I bet you're happy.
 
S

samearle

We'll, I am happy there is a new post to my thread, thanks Dave. Only
wish you'd said something helpful! LOL!

Colors should travel too, yes, but they do not. I've done a few tests
to recreate:

To london from us, when they send back to us, the colors are changed
all the time. I atributed this to the UK program beinig a bit diferent?
Also, when I open a doc and change colors, then open the old doc with
the custom colors, they change.

Many diferent custom colors change, when doc gets reopened here and
abroad.

That is why I wanted to add this VBA - so whenever, wherever the
document gets opened. The colors get changed to what I want them to be.

Thanks,

Sam

PS - It'd be nice to be able to name the colors in the palette too!
 
D

Dave Peterson

I've never seen the colors change--except when I or something else actually
changes them. It surprises me that you're experiencing something else.
 

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