Name

axis.DisplayUnit [= xlDisplayUnit]

Synopsis

For value axes, sets or returns the numeric scale used by the axis. Default is xlNone. Can be one of these settings:

xlCustom

xlHundreds

xlHundredMillions

xlHundredThousands

xlMillions

xlMillionMillions

xlNone (default)

xlTenMillions

xlTenThousands

xlThousands

xlThousandMillions

 

Setting this property adds a DisplayUnitLabel to the axis. For example, the following code sets the scale of the value axis and changes the display unit caption:

Sub SetAxisScale(  )
    Dim chrt As Chart, ax As Axis
    Set chrt = ActiveSheet
    Set ax = chrt.Axes(xlValue, xlPrimary)
    ax.DisplayUnit = xlThousands
    ax.DisplayUnitLabel.Caption = "(in $K)"
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.