Move a DataLabel in a chart in excel

Hello,

I would like to be able to move the DataLabel in the example below in all directions. Can I somehow find the Top and Left data for it

With ActiveChart.SeriesCollection(1)
.ApplyDataLabels Type:=xlDataLabelsShowLabel, _
AutoText:=False, _
LegendKey:=False
.DataLabels.Position = xlLabelPositionRight

Kind regards

\Jonas




Answer this question

Move a DataLabel in a chart in excel

  • Loopsludge

    You can read and set the Left and Top properties of a data label.
    This simple example move each label down and across by 10.

    Note I have changed the AutoText to TRUE as FALSE was generating a 1004 error.

    Sub MoveDataLabels()

    Dim objDL As DataLabel

    With ActiveChart.SeriesCollection(1)
    .ApplyDataLabels Type:=xlDataLabelsShowLabel, _
    AutoText:=True, _
    LegendKey:=False
    .DataLabels.Position = xlLabelPositionRight
    For Each objDL In .DataLabels
    objDL.Left = objDL.Left + 10
    objDL.Top = objDL.Top + 10
    Next
    End With

    End Sub





  • Pascal Mignot

    Thanks!

  • Move a DataLabel in a chart in excel