roc_on_the_rocks
Board Regular
- Joined
- Jun 6, 2009
- Messages
- 175
- Office Version
- 365
- Platform
- Windows
Hello folks,
I'm trying to clean up this piece of charting code...
... from this:
to this:
But it crashes with the error message: "Compile error: Sub or Function not defined"
Any help will be very appreciated.
Thanks!
I'm trying to clean up this piece of charting code...
... from this:
Code:
'add Temperature series
With ActiveChart
.SeriesCollection.NewSeries
.SeriesCollection(2).Name = y2Title
.SeriesCollection(2).XValues = xData
.SeriesCollection(2).Values = y2Data
.SeriesCollection(2).Border.ColorIndex = 6
.SeriesCollection(2).Border.Weight = xlThin
.SeriesCollection(2).Border.LineStyle = xlContinuous
End With
to this:
Code:
'add Temperature series
With ActiveChart
.SeriesCollection.NewSeries
With [COLOR=red]SeriesCollection[/COLOR](2)
.Name = y2Title
.XValues = xData
.Values = y2Data
.Border.ColorIndex = 6
.Border.Weight = xlThin
.Border.LineStyle = xlContinuous
End With
End With
But it crashes with the error message: "Compile error: Sub or Function not defined"
Any help will be very appreciated.
Thanks!
Last edited: