Hello -
I have the following code:
'Total Charts
Sheets(wsCntAggSpec).Activate
Range("b" & 14 + yr - minyr).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Range("C8:D" & 8 + yr - minyr)
Series = 1
For Series = 1 To yr - minyr
ActiveChart.SeriesCollection(Series).Name = minyr + Series - 1
Next Series
ActiveChart.ApplyLayout (3)
ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "Total Book of Business"
ActiveChart.ApplyLayout (1)
And I am having 2 issues.
1. when naming the series I am getting an invalid parameter error when it hits 2011 (starts at 2009) and I have no idea why.
2. the second issue is that I would like to place the chart at the range specified (Sheets(wsCntAggSpec).Activate
Range("b" & 14 + yr - minyr).Select) if at all possible.
I have tried to go with selection.Shapes.AddChart.Select but it did not like that.
Any help would be greatly appreciated.
Thanks in advance
Dave
I have the following code:
'Total Charts
Sheets(wsCntAggSpec).Activate
Range("b" & 14 + yr - minyr).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Range("C8:D" & 8 + yr - minyr)
Series = 1
For Series = 1 To yr - minyr
ActiveChart.SeriesCollection(Series).Name = minyr + Series - 1
Next Series
ActiveChart.ApplyLayout (3)
ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "Total Book of Business"
ActiveChart.ApplyLayout (1)
And I am having 2 issues.
1. when naming the series I am getting an invalid parameter error when it hits 2011 (starts at 2009) and I have no idea why.
2. the second issue is that I would like to place the chart at the range specified (Sheets(wsCntAggSpec).Activate
Range("b" & 14 + yr - minyr).Select) if at all possible.
I have tried to go with selection.Shapes.AddChart.Select but it did not like that.
Any help would be greatly appreciated.
Thanks in advance
Dave