VBA for Legend label

  • Thread starter Thread starter Tim Hart
  • Start date Start date
T

Tim Hart

Guest
How can I change the legend label with VBA. I found out how to show or hide a legend, but how to change the name?

With Chart
.HasLegend = True
. ???
End With

Thanks for your help!
Tim
 
Is it not Legend.Caption = value?
 
does't work either ;-(
 
Legend

Hi Tim,
If you hit the F2 function key while in the VBA editor you will see a list of classes, properties and objects and the members of each object. You will see that the 'Legend' Class has no 'Text' or 'Caption' property. It does however have a LegendEntries property (or method). I believe this is read/write so you should be able to modify this at run time. Good luck!
Ed
 

Users who are viewing this thread

Back
Top Bottom