Table of contents
TOC
Collapse the table of content
Expand the table of content

DataLabels Object (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

A collection of all the DataLabel objects for the specified series.

Remarks

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.

Example

Note Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

Use the DataLabels method to return the DataLabels collection. The following example sets the number format for data labels on the first series of the first chart in the active document.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        With Chart.SeriesCollection(1)

            .HasDataLabels = True

            .DataLabels.NumberFormat = "##.##"

        End With

    End If

End With

Note Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

Use DataLabels ( Index ), where Index is the data label index number, to return a single DataLabel object. The following example sets the number format for the fifth data label in the first series of the first chart in the active document.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        With Chart.SeriesCollection(1).DataLabels(5)

            .NumberFormat = "0.000"

        End With

    End If

End With

See also

Concepts

PowerPoint Object Model Reference

© 2017 Microsoft