Adding a single label to the end of a data series in a line graph
I have three data series plotted on my graph, the first two are measured against the primary and secondary axis plotting ... no problems.
For my third series I want to add a label at the end of the series that prints the current value (series grows over the day). Anyone know how to do this?
A google returns 1001 easy tutorials on the basics :(
Re: Adding a single label to the end of a data series in a line graph
Kiwi,
Try something like this:
Code:
Sub labelIt()
Dim ChrtObj As ChartObject
Set ChrtObj = ActiveSheet.ChartObjects(1)
ChrtObj.Chart.SeriesCollection(1).Points(3).HasDataLabel = True
'above line of code puts a label on the 3rd (last) data point
End Sub
Sub in whichever series you want to add the label for (probably 3).