Change legend text in Excel Chart

  • Thread starter Thread starter quest
  • Start date Start date
Q

quest

Dim appAs Excel.Application
Dim chart As Excel.Chart
Set app = CreateObject("Excel.Application")

chart.HasLegend = true

My problem is how do I change the label of the legend used in the
excel.chart ? Can someone show me how to access it ? thanks.
 
Quest

You use the Name property of the SeriesCollection method like so

This will set the name property of seriescollection 1 to the value test

Chart.SeriesCollection(1).Name = "=""Test"""

Not sure if Excel will like you using the variable Chart??

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Back
Top