PC Review


Reply
Thread Tools Rate Thread

Changing Series Colour with VBA??

 
 
baconcow
Guest
Posts: n/a
 
      5th May 2008
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
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      5th May 2008
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" <(E-Mail Removed)> wrote in message
news:23923215-7F20-4B5F-8565-(E-Mail Removed)...
> 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



 
Reply With Quote
 
baconcow
Guest
Posts: n/a
 
      5th May 2008
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" <(E-Mail Removed)> wrote in message
> news:23923215-7F20-4B5F-8565-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      5th May 2008
> 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" <(E-Mail Removed)> wrote in message
news:B657150C-92E3-4D67-84A2-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:23923215-7F20-4B5F-8565-(E-Mail Removed)...
> > > 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

> >
> >
> >



 
Reply With Quote
 
baconcow
Guest
Posts: n/a
 
      5th May 2008
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" <(E-Mail Removed)> wrote in message
> news:B657150C-92E3-4D67-84A2-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > > news:23923215-7F20-4B5F-8565-(E-Mail Removed)...
> > > > 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
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      5th May 2008
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" <(E-Mail Removed)> wrote in message
news:77428EFC-66E4-4CF0-A315-(E-Mail Removed)...
> 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
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking changes - author colour colour changing bradsmih Microsoft Word Document Management 5 25th Jan 2010 02:36 AM
xl 2000 - changing chart colour doesn't update legend colour insert your name here Microsoft Excel Discussion 2 10th Sep 2006 09:25 AM
Changing series information for approximately 60 series in a workb =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Charting 2 18th Jan 2006 10:22 PM
Series colour changing Deborah Microsoft Excel Charting 0 24th Feb 2004 04:28 PM
Changing a series' Name, X- and Y-values by using its series number L Mehl Microsoft Excel Charting 4 4th Feb 2004 01:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 AM.