0
SarahC07

MS Excel - Visual Basic

Recommended Posts

I want to tell excel what color to make the series in a bar chart. Can this be changed in VB? I'll need to use the IF function or something similar, because the data in the series does not dicate what color I want it... another variable does.

Does that make sense?

Can anyone help?

Share this post


Link to post
Share on other sites
If you know a bit of VBA then this will help:

Quote


Use SeriesCollection(index), where index is the series index number or name, to return a single Series object. The following example sets the color of the interior for the first series in embedded chart one on Sheet1.

Worksheets("sheet1").ChartObjects(1).Chart. _
SeriesCollection(1).Interior.Color = RGB(255, 0, 0)


References:
http://msdn.microsoft.com/en-us/library/aa213725(office.11).aspx
http://msdn.microsoft.com/en-us/library/aa174298(office.11).aspx

Hope that helps.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0