Skip to content

Latest commit

 

History

History
89 lines (45 loc) · 2.12 KB

PowerPoint.Series.DataLabels.md

File metadata and controls

89 lines (45 loc) · 2.12 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Series.DataLabels method (PowerPoint)
vbapp10.chm65693
vbapp10.chm65693
PowerPoint.Series.DataLabels
e1e37006-8a4d-9a55-02a4-890ec5e608db
06/08/2017
medium

Series.DataLabels method (PowerPoint)

Returns an object that represents either a single data label (a DataLabel object) or a collection of all the data labels for the series (a DataLabels collection).

Syntax

expression.DataLabels (Index)

expression A variable that represents a 'Series' object.

Parameters

Name Required/Optional Data type Description
Index Optional Variant The number of the data label.

Return value

An object that represents either a single data label (a DataLabel object) or a collection of all the data labels for the series (a DataLabels collection).

Remarks

If the series has the Show Value option turned on for the data labels, the returned collection can contain up to one label for each point. Data labels can be turned on or off for individual points in the series.

If the series is on an area chart and has the Show Label option turned on for the data labels, the returned collection contains only a single label, which is the label for the area series.

Example

Note

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

The following example sets the data labels for series one for the first chart in the active document to show their key, assuming that their values are visible when the example runs.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        With .Chart.SeriesCollection(1)

            .HasDataLabels = True

            With .DataLabels

                .ShowLegendKey = True

                .Type = xlValue

            End With

        End With

    End If

End With

See also

Series Object

[!includeSupport and feedback]