April 2006
Beginner
1114 pages
98h 16m
English
datalabel.Separator [= setting]
Sets or returns the character used between the data label and the category name, legend key, or series name if one or more of those are included in the data label. Default is a comma.
The following code demonstrates using the Separator property along with the other data label display items:
Sub FullDataLabels( )
Dim chrt As Chart, sr As Series, ds As DataLabels
Set chrt = ActiveChart
chrt.ChartType = xlLine
' Get the first series.
Set sr = chrt.SeriesCollection(1)
' Make sure data labels exist.
sr.HasDataLabels = True
' Get the DataLabels collection.
Set ds = sr.DataLabels
' Display all of the available info.
ds.ShowCategoryName = True
ds.ShowLegendKey = True
ds.ShowSeriesName = True
' Use semicolon between items.
ds.Separator = ";"
End SubRead now
Unlock full access