A
Ajay_N
Hello,
I am trying to generate a chart with multiple series. The number o
series is not fixed and can be any number. I recorded a macro and the
modified the code. 'Counter' refers to the number of the series and
have referenced it in a worksheet. I am getting the error in the lin
that is bold. Thank you for your help.
The code is as follows:
Dim Counter As Integer
Dim i As Integer
Sheets("With TC").Select
Counter = Cells(38, 13).Value
ActiveChart.ChartType = xlLine
With Sheets("VP_WithTC")
ActiveChart.SetSourceData Source:=.Range(.Cells(2, 13)
.Cells(Counter, 16)), PlotBy _
:=xlRows
End With
For i = 2 To Counter
With ActiveChart.SeriesCollection.NewSeries
*.Values = ActiveSheet.Range(Cells(i, 13), Cells(i, 16))*
.XValues = ActiveSheet.Range("E1:H1")
End With
Next i
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Value Path Graph"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text
"Criteria"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text
"Normalized values"
End With
End Su
I am trying to generate a chart with multiple series. The number o
series is not fixed and can be any number. I recorded a macro and the
modified the code. 'Counter' refers to the number of the series and
have referenced it in a worksheet. I am getting the error in the lin
that is bold. Thank you for your help.
The code is as follows:
Dim Counter As Integer
Dim i As Integer
Sheets("With TC").Select
Counter = Cells(38, 13).Value
ActiveChart.ChartType = xlLine
With Sheets("VP_WithTC")
ActiveChart.SetSourceData Source:=.Range(.Cells(2, 13)
.Cells(Counter, 16)), PlotBy _
:=xlRows
End With
For i = 2 To Counter
With ActiveChart.SeriesCollection.NewSeries
*.Values = ActiveSheet.Range(Cells(i, 13), Cells(i, 16))*
.XValues = ActiveSheet.Range("E1:H1")
End With
Next i
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Value Path Graph"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text
"Criteria"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text
"Normalized values"
End With
End Su