Edit DataLabel in Excel charts

Hi all,

I wonder have I can add a Legend Key(a line that goes from the point in the chart to DataLabel text) to the DataLabel in the code below I would also like to now how I can change the position of the DataLabel.

With ActiveChart
    With .SeriesCollection(1).Points(2)
        .HasDataLabel = True
        .DataLabel.Text = "Saturday"
    End With
End With

Thankful for tips.

Jonas




Answer this question

Edit DataLabel in Excel charts

  • DrewW

    Thanks Andy!

  • ACCOUNTINGONLINE.US

    Maybe this example of leader lines will help.
    http://www.andypope.info/ngs/ng14.htm

    To change the position of the data label you can use code like this.

    ' using built in label positions. Positions available depend on chart type
    activechart.SeriesCollection(1).points(2).datalabel.position = xlLabelPositionAbove

    ' or explicitly set position of label using Left and Top values
    activechart.SeriesCollection(1).points(2).datalabel.Left = 30
    activechart.SeriesCollection(1).points(2).datalabel.Top = 30



  • Edit DataLabel in Excel charts