colour palette

  • Thread starter Thread starter funkymonkUK
  • Start date Start date
F

funkymonkUK

Hi

I found a colour on Powerpoint which I would like to use in Exce
however excel colour pallete does not have it is there a way to us
that colour some other way or to add it to the pallette.

Using Office 97
 
You can modify a workbook's colour palette.

Goto Tools>Options>Color, select one of the colours and then click Modify.
You can change the colour constituents of that palette colour.

--
HTH

Bob Phillips

"funkymonkUK" <[email protected]>
wrote in message
news:[email protected]...
 
Bob Phillips shared this with us in microsoft.public.excel.programming:
You can modify a workbook's colour palette.

Goto Tools>Options>Color, select one of the colours and then click
Modify. You can change the colour constituents of that palette
colour.

I have two additional questions on this subject:

1. Is there some "deep wizardry" to change this programmatically? If
need be with API calls or the casting of elvish runes?
2. Is this a global setting, or per file?


I already asked this in the Dutch ng (sorry for the multipost), but
have not yet got a reply. There are more and other ppl in this ng,
perhaps someone here knows?
 
I have two additional questions on this subject:

1. Is there some "deep wizardry" to change this programmatically? If
need be with API calls or the casting of elvish runes?

Not sure what you mean by deep wizardy, but you can set a colour
programmatically very easily

Activeworkbook.Colors(3) = RGB(0,0,255)

changes colour 3, which is usually red, to blue. As I am sure that you can
see it can be any hue between white and black by using the relevant RGB
value.
2. Is this a global setting, or per file?

It is per file. The way to make it global is to open Book.xlt from the
start directory and modify that and save it. Any new books then assume this
value.
 
Bob Phillips shared this with us in microsoft.public.excel.programming:
Not sure what you mean by deep wizardy, but you can set a colour
programmatically very easily

Activeworkbook.Colors(3) = RGB(0,0,255)

changes colour 3, which is usually red, to blue. As I am sure that
you can see it can be any hue between white and black by using the
relevant RGB value.

Have you tried this yourself?
At least in Excel 2000, any RGB color you use snaps back to the nearest
color in the 40 color palette.
I tried this with a 3D chart (let's say frequency, amplitude, time). I
wanted to have different shades of the same color, so I had something
like this in my code (from memory):

blablabla(i).Color = RGB(0, 0, Int(255 * i /n))

where i is increased in a loop and n is the number of shades of blue,
obviously.

The result was only 3 shades of blue that happened to be in the
palette. Bollocks.


Duh...
PARSING ERROR DETECTED. BACKTRACING...
|^H\^H-^H/^H|^H\^H-^H/^H|^H\^H-^H/^H|^H\^H-^H/^H|^H\^H-^H/^H|

OK, now I finally understand what you mean.
So essentially I have to do the following:

1. Determine how many shades I need with blablabla.Count
2. A loop with Activeworkbook.Colors(i) = RGB(0, 0, Int(255 * i /n))
3. A loop with blablabla(i).Color = Activeworkbook.Colors(i)

This still needs some polishing, but I can grok the general concept.
Thank you, and May The Force Be With You ;-)
It is per file. The way to make it global is to open Book.xlt from
the start directory and modify that and save it. Any new books then
assume this value.

OK. I need it to be per file. Saving it before changes and restoring it
again when I close the wb really blows.
 
It would help if you just posted what you finally understood rather than you
internal mumblings that got you there. I have just spent ten minutes
double-checking my words and how Excel works because of your opening
statements, which did not reflect what I said. Ten minutes wasted.

I said that you can change the colour, I didn't say you can use any colour
within the spectrum within code.

Excel only has a colour palette of 56 colours, so any colour you try to use
snaps back to one of those as you say. But you can define what those 56
colours are.

And there was no need for the profanity in the light of your later
understanding.

Bob
 
Sub Shadesofblue()

j = 0
For i = 1 To 255 Step Application.RoundUp(255 / 56, 0)
j = j + 1
ActiveWorkbook.Colors(j) = RGB(0, 0, i)
Cells(j, 1).Interior.ColorIndex = j
Next
End Sub
 
Bob Phillips shared this with us in microsoft.public.excel.programming:

Bob,

I would like to excuse myself for two things.

1. I got a bit carried away in my "stream of consciousness". Only the
conclusion was enough. Agreed. There was perhaps more than one hour
between the first part of my post and the last. This is not an exuse,
it's only an explanation.

2. I didn't fully realise that some words evoke such an emotional
reaction for native speakers such as yourself. Some words in a foreign
language one picks up and uses at random without really knowing what
they mean. I have just looked them up in a dictionary, and now I am
ashamed of myself. Sorry. Mea culpa.
 
Back
Top