Changing Series Colour with VBA??

B

baconcow

Under "Format Data Series", how do I use VBA to change the "Marker Fill" to a
"Solid fill" colour of my choice? I don't want to use their default colours.

Thanks
 
J

Jon Peltier

By default colors, do you mean the default color the marker has when the
chart is created, or do you mean the 56 colors in the palette?

- Jon
 
B

baconcow

Hey,

I JUST found the answer I was looking for on an MSDN page. I wish the VB
Developer help files were more detailed like that website.

This is the code I ended up using and it seems to work fine:
ch111.SeriesCollection(2).MarkerBackgroundColor = RGB(192, 0, 0)

This is the maroon chosen from their default colour pallet.
 
P

Peter T

This is the maroon chosen from their default colour pallet.

There is no such named colour, neither does RGB(192,0,0) exist in the
default colour palette of 56 colours.

When you apply some RGB colour value the nearest colour that already exists
in the palette will be applied. Or rather ColorIindex(X) is applied where X
is the index of the nearest matched palette colour.

If your palette is uncustomized I would expect colorindex(3),
RGB(255,0,0,0), Red to be applied with your example.

Regards,
Peter T
 
B

baconcow

Heh, I know. I said Maroon for my reference. The actual name of the colour
that I chose was "Dark Red". The other colours I chose were "Green" and "Dark
Blue, Text 2". I just didn't know how to reference the colour without using
the RGB statement. Yeah, to me, it was similar to maroon. But, yeah, it is a
little darker.

Do you know how to change the colour of the lines (found in Format Data
Series)? I can't figure this one out.

In Microsoft Office 2007 (192, 0, 0) exists at the far left of the 10
"Standard Colors". But, you're right, it does not exist in their pallet of 56
default theme colours.

Thanks for the help!
 
P

Peter T

I forgot about 2007 !

Slightly strange that Dark Red in Excel 2007 is RGB(192,0,0)
whereas in previous versions it is RGB(128,0,0)

Regards,
Peter T
 

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