Posts by goullis

    Hi


    I need some help with chart data labelling via vba. The following code applies a data label for a clicked point on an x-y scatter chart. However, I have 2 issues:


    1) It only works where the chart is it's own object i.e. the chart is in it's own tab. I want it to work on a chart within a sheet.
    2) When moving to the next chart point the previous label remains but i want this to disappear


    I am using Excel 2010


    Private Sub Chart_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)


    Select Case ElementID
    Case xlSeries
    If Arg2 > 0 Then
    MyPoint = Arg2


    Label = Range("Scatter!A3:A500").Cells(MyPoint).Value
    ActiveChart.SeriesCollection(1).Points(MyPoint).HasDataLabel = True
    ActiveChart.SeriesCollection(1).Points(MyPoint).DataLabel.Text = Label


    End If
    Case Else
    End Select
    End Sub


    Please help


    Thanks