Class DataLabels (Excel VBA)

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

Class Series gives access to class DataLabels.


Dim dls as DataLabels
Set dls = ActiveChart.FullSeriesCollection(1).DataLabels()

For Each

Here is an example of processing the DataLabels items in a collection.


Dim dtl As DataLabel
For Each dtl In ActiveCell.Width.DataLabels()
	
Next dtl

Methods

Delete - Deletes the object.

Item - Returns a single object from a collection.

Propagate - Enables you to take the contents and formatting of a single data label and apply it to every other data label in the series.

Select - Selects the object.

Properties

AutoText true if the object automatically generates appropriate text based on context.

Count returns a Long value that represents the number of objects in the collection.

Format returns the ChartFormat object.

HorizontalAlignment returns or sets a value that represents the horizontal alignment for the specified object.

Name returns a String value that represents the name of the object.

NumberFormat returns or sets a String value that represents the format code for the object.

NumberFormatLinked true if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

NumberFormatLocal returns or sets a value that represents the format code for the object as a string in the language of the user.

Orientation returns or sets a value that represents the text orientation.

Position returns or sets an XlDataLabelPosition value that represents the position of the data label.

ReadingOrder returns or sets the reading order for the specified object. Can be one of the following XlReadingOrder constants: xlRTL (right-to-left), xlLTR (left-to-right), or xlContext.

Separator sets or returns a Variant representing the separator used for the data labels on a chart.

Shadow returns or sets a Boolean value that determines if the object has a shadow.

ShowBubbleSize true to show the bubble size for the data labels on a chart. False to hide.

ShowCategoryName true to display the category name for the data labels on a chart. False to hide.

ShowLegendKey true if the data label legend key is visible.

ShowPercentage true to display the percentage value for the data labels on a chart. False to hide.

ShowRange used to toggle the Range field if it exists on the data label range.

ShowSeriesName returns or sets a Boolean to indicate the series name display behavior for the data labels on a chart. True to show the series name. False to hide.

ShowValue returns or sets a Boolean corresponding to a specified chart's data label values display behavior. True displays the values. False to hide.

VerticalAlignment returns or sets a value that represents the vertical alignment of the specified object.