ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Series Colour with VBA?? (https://www.excelbanter.com/excel-programming/410485-changing-series-colour-vba.html)

baconcow

Changing Series Colour with VBA??
 
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

Jon Peltier

Changing Series Colour with VBA??
 
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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"baconcow" wrote in message
...
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




baconcow

Changing Series Colour with VBA??
 
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.

"Jon Peltier" wrote:

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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"baconcow" wrote in message
...
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





Peter T

Changing Series Colour with VBA??
 
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


"baconcow" wrote in message
...
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.

"Jon Peltier" wrote:

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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"baconcow" wrote in message
...
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







baconcow

Changing Series Colour with VBA??
 
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!

"Peter T" wrote:

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


"baconcow" wrote in message
...
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.

"Jon Peltier" wrote:

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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"baconcow" wrote in message
...
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







Peter T

Changing Series Colour with VBA??
 
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

"baconcow" wrote in message
...
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!

"Peter T" wrote:

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





All times are GMT +1. The time now is 07:15 AM.

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