B
Bagger
I'm using the following code to set up my series for a 2-axis column / line
chart. The first series is for the columns, and the second is for the line.
I am able to set the line and marker colors for the second series, but I
can't figure out how to set the color for the columns of the first series.
You'll see that I even tried to do it by going through each point, but that
didn't work either.
There seems to be no intellisense for this stuff, and some of the properties
don't seem to even be listed in the online documentation (example, Border
isn't listed as a property of the Series object here :
http://msdn.microsoft.com/en-us/library/bb255883.aspx). The macro recorder
doesn't seem to record changes to series formats either. Where exactly
should I be finding info on this stuff that is specific to Excel 2007??
With chtChart
.ChartType = xlColumnClustered
'Set data source range.
' remove extra series
Do Until .SeriesCollection.Count = 0
.SeriesCollection(1).Delete
Loop
.SeriesCollection.NewSeries
.SeriesCollection(1).Values = rngDollars
.SeriesCollection(1).XValues = rngQuarters
.SeriesCollection(1).Interior.Color = RGB(153, 51, 102)
.SeriesCollection.NewSeries
.SeriesCollection(2).Values = rngTOs
.SeriesCollection(2).AxisGroup = 2
.SeriesCollection(2).ChartType = xlLine
.SeriesCollection(2).Border.Color = RGB(0, 0, 128)
.SeriesCollection(2).MarkerStyle = xlMarkerStyleDiamond
.SeriesCollection(2).MarkerForegroundColor = RGB(0, 0, 128)
.SeriesCollection(2).MarkerBackgroundColor = RGB(0, 0, 128)
'set colors
Dim intPoint As Integer
With .SeriesCollection(1)
For intPoint = 1 To .Points.Count
.Points(intPoint).Interior.Color = RGB(153, 51, 102)
Next
End With
End With
chart. The first series is for the columns, and the second is for the line.
I am able to set the line and marker colors for the second series, but I
can't figure out how to set the color for the columns of the first series.
You'll see that I even tried to do it by going through each point, but that
didn't work either.
There seems to be no intellisense for this stuff, and some of the properties
don't seem to even be listed in the online documentation (example, Border
isn't listed as a property of the Series object here :
http://msdn.microsoft.com/en-us/library/bb255883.aspx). The macro recorder
doesn't seem to record changes to series formats either. Where exactly
should I be finding info on this stuff that is specific to Excel 2007??
With chtChart
.ChartType = xlColumnClustered
'Set data source range.
' remove extra series
Do Until .SeriesCollection.Count = 0
.SeriesCollection(1).Delete
Loop
.SeriesCollection.NewSeries
.SeriesCollection(1).Values = rngDollars
.SeriesCollection(1).XValues = rngQuarters
.SeriesCollection(1).Interior.Color = RGB(153, 51, 102)
.SeriesCollection.NewSeries
.SeriesCollection(2).Values = rngTOs
.SeriesCollection(2).AxisGroup = 2
.SeriesCollection(2).ChartType = xlLine
.SeriesCollection(2).Border.Color = RGB(0, 0, 128)
.SeriesCollection(2).MarkerStyle = xlMarkerStyleDiamond
.SeriesCollection(2).MarkerForegroundColor = RGB(0, 0, 128)
.SeriesCollection(2).MarkerBackgroundColor = RGB(0, 0, 128)
'set colors
Dim intPoint As Integer
With .SeriesCollection(1)
For intPoint = 1 To .Points.Count
.Points(intPoint).Interior.Color = RGB(153, 51, 102)
Next
End With
End With