Results 1 to 2 of 2

Thread: Adding a single label to the end of a data series in a line graph

  1. #1
    Hyperactive Member
    Join Date
    Oct 07
    Location
    Godzone, oops Oz
    Posts
    354

    Question 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
    http://www.scaryminds.com - Horror's last colonial outpost.

  2. #2
    Fanatic Member
    Join Date
    Oct 08
    Location
    Midwest Region, United States
    Posts
    985

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •