Microsoft Office Tutorials and References
In Depth Information
Try It
‘Color the legend entries to identify each pie piece.
With ActiveChart.Legend
.LegendEntries(1).LegendKey.Interior.Color = vbYellow
.LegendEntries(2).LegendKey.Interior.Color = vbCyan
.LegendEntries(3).LegendKey.Interior.Color = vbRed
.LegendEntries(4).LegendKey.Interior.Color = vbGreen
End With
‘Add data labels to see the numbers in the pie slices.
ActiveChart.SeriesCollection(1).ApplyDataLabels
‘Edit the chart title’s text
ActiveChart.ChartTitle.Text = “Quarterly Sales”
‘Format the legend.
ActiveChart.Legend.Select
With Selection.Font
.Name = “Arial”
.FontStyle = “Bold”
.Size = 14
End With
‘Deselect the chart by selecting a cell.
Range(“A1”).Select
End Sub
figurE 14-5
To view the video that accompanies this lesson, please select Lesson 14, available
at the following website: www.wrox.com/go/excelvba .
Search JabSto ::




Custom Search