LegendEntries Collection Object

Description

A collection of all the LegendEntry objects in the specified chart legend. Each legend entry has two parts: the text of the entry, which is the name of the series or trendline associated with the legend entry; and an entry marker, which visually links the legend entry with its associated series or trendline in the chart. Formatting properties for the entry marker and its associated series or trendline are contained in the LegendKey object.

Accessors

Use the LegendEntries method with an argument to access a single member of the collection or without an argument to access the entire collection at once. The following example loops through the collection of legend entries and changes the color of their fonts.


With Worksheets("sheet1").ChartObjects(1).Chart.Legend
    For i = 1 To .LegendEntries.Count
        .LegendEntries(i).Font.ColorIndex = 5
    Next
End With

Properties

Application Property, Count Property, Creator Property, Parent Property.

Methods

Item Method.