Hi,
Below is Part of my code. I am hoping someone can explain as to why the seriescollection.values do not work properly.An error does not occur but nothing is put into the source data. The series name code changes correctly..
Any help can be appreciated.
Thanks!
Below is Part of my code. I am hoping someone can explain as to why the seriescollection.values do not work properly.An error does not occur but nothing is put into the source data. The series name code changes correctly..
Any help can be appreciated.
Thanks!
Code:
Current_Month = Data_Sheet.Cells.Find(What:=FrmChart.CMB_Date.Value, after:=ActiveCell).Column
Start_Month = Data_Sheet.Cells.Find(What:=FrmChart.CMB_Date.Value, after:=ActiveCell).Column - 11
Product_Count = 0
Do While Product_Count <= Total_IPT
RowCount = 7
Do While Cells(RowCount, 2).Value <> ""
If Left(Cells(RowCount, 2).Value, Application.WorksheetFunction.Find(" ", Cells(RowCount, 2).Value, 1) - 1) = Product_Team(Product_Count) Then
Set IPT_Chart = Charts.Add
Set Chart_Sheet = ActiveSheet
Chart_Sheet.Name = Product_Team(Product_Count)
With IPT_Chart
.ChartType = xlLine
.SeriesCollection.NewSeries
.SeriesCollection(1).Name = Data_Sheet.Cells(RowCount + 10, 4).Value
.SeriesCollection(1).Values = Data_Sheet.Range(Cells(RowCount + 10, Start_Month), Cells(RowCount + 10, Current_Month))
.SeriesCollection.NewSeries
.SeriesCollection(2).Name = Data_Sheet.Cells(RowCount + 11, 4).Value
.SeriesCollection(2).Values = Data_Sheet.Range(Cells(RowCount + 11, Start_Month), Cells(RowCount + 11, Current_Month))
.SeriesCollection.NewSeries
.SeriesCollection(3).Name = Data_Sheet.Cells(RowCount + 12, 4).Value
.SeriesCollection(3).Values = Data_Sheet.Range(Cells(RowCount + 12, Start_Month), Cells(RowCount + 12, Current_Month))
.SeriesCollection.NewSeries
.SeriesCollection(4).Name = Data_Sheet.Cells(RowCount + 13, 4).Value
.SeriesCollection(4).Values = Data_Sheet.Range(Cells(RowCount + 13, Start_Month), Cells(RowCount + 13, Current_Month))
.SeriesCollection(1).XValues = Data_Sheet.Range(Cells(6, Start_Month), Cells(6, Current_Month))
.HasTitle = True
.ChartTitle.Characters.Text = Product_Team(Product_Count) & " SPI/CPI Trend"
.Location Where:=xlLocationAsObject, Name:=Chart_Sheet
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Month"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "SPI/CPI"
.HasDataTable = True
.DataTable.ShowLegendKey = True
End With
Product_Count = Product_Count + 1
Exit Do
End If
RowCount = RowCount + 1
Loop
Data_Sheet.Activate
Loop