By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

Change bar color on bar graph

100+
P: 219
I'm trying to change the colors for the bars on the bar graph. In the design view I can only change 4 bars, but my graph has 6 bars. How do I go about changing the other bars on the graph?
Feb 8 '08 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
I'm trying to change the colors for the bars on the bar graph. In the design view I can only change 4 bars, but my graph has 6 bars. How do I go about changing the other bars on the graph?
I don't understand why you can't change the other 2 bars. It does not make sense. You need to provide more details. You are welcome to try the following vba code and see if that helps. Replace illustrative objects (YourChartContainerObject/YourChartObject) with your actual objects.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.  
  3.        With Me.YourChartContainerObject.YourChartObject
  4.            .SeriesCollection(1).Interior.Color = RGB(255, 128, 128) 'peach
  5.            .SeriesCollection(2).Interior.Color = RGB(0, 255, 128) 'green
  6.            .SeriesCollection(3).Interior.Color = RGB(0, 128, 255) 'blue
  7.            .SeriesCollection(4).Interior.Color = RGB(128, 255, 255) 'turquoise
  8.            .SeriesCollection(5).Interior.Color = RGB(255, 255, 128) 'yellow
  9.            .SeriesCollection(0).Interior.Color = RGB(255, 0, 255) 'magenta
  10.        End With
  11.  
  12. End Sub
  13.  
Feb 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.