Class DataLabel (Excel VBA)

The class DataLabel represents the data label on a chart point or trendline.

The classes Point and Trendline. give access to class DataLabel


Dim dtl as DataLabel
Set dtl = ActiveCell.Width(1).DataLabel

For Each

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


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

Methods

Delete - Deletes the object.

Select - Selects the object.

Properties

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

Caption returns or sets a String value that represents the data label text.

Characters returns a Characters object that represents a range of characters within the object text. You can use the Characters object to format characters within a text string.

Format returns the ChartFormat object.

Formula gets or sets a String value that represents the formula of the object using A1-style notation, in English.

FormulaLocal gets or sets a String value that represents the formula of the object using A1-style notation, in the language of the user.

FormulaR1C1 gets or sets a String value that represents the formula of the object using R1C1-style notation, in English.

FormulaR1C1Local gets or sets a String value that represents the formula of the object using R1C1-style notation, in the language of the user.

Height returns the height of the object in points.

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

Left returns or sets a Double value that represents the distance, in points, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).

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.

Text returns or sets the text for the specified object.

Top returns or sets a Double value that represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart).

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

Width returns the width of the object in points.

Characters - Represents characters in an object that contains text.

ChartFormat - Provides access to the Office Art formatting for chart elements.