DataLabels collection (Excel Graph)
A collection of all the DataLabel objects for the specified series. Each DataLabel object represents a data label for a point or trendline. For a series without definable points (such as an area series), the DataLabels collection contains a single data label.
Remarks
Use the DataLabels method to return the DataLabels collection.
Use DataLabels (index), where index is the data label's index number, to return a single DataLabel object.
Example
The following example sets the number format for data labels in series one in the chart.
With myChart.SeriesCollection(1)
.HasDataLabels = True
.DataLabels.NumberFormat = "##.##"
End With
The following example sets the number format for the fifth data label in series one in the chart.
myChart.SeriesCollection(1).DataLabels(5).NumberFormat = "0.000"
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for