DisplayUnitLabel Object (PowerPoint)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents a unit label on an axis in the specified chart.

Unit labels are useful for charting large values (for example, in the millions or billions). You can make the chart more readable by using a single unit label instead of large numbers at each tick mark.

Note Note

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

Use the DisplayUnitLabel property to return the DisplayUnitLabel object. The following example sets the display label caption to "Millions" on the value axis of the first chart in the active document, and then the example turns off automatic font scaling.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        With .Chart.Axes(xlValue)

            .DisplayUnit = xlMillions

            .HasDisplayUnitLabel = True

            With .DisplayUnitLabel

                .Caption = "Millions"

                .AutoScaleFont = False

            End With

        End With

    End If

End With
Show: