A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro code to put series name next to individual line in line grap



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2010, 09:09 PM posted to microsoft.public.excel.charting
Otani
external usenet poster
 
Posts: 4
Default Macro code to put series name next to individual line in line grap

I want to put the series names next to their corresponding line in the line
graph. I remember seeing on the internet that there is a macro code for this
but I cannot find this anymore. Does anyone know what the macro code is?
  #2  
Old February 23rd, 2010, 07:31 AM posted to microsoft.public.excel.charting
Misange
external usenet poster
 
Posts: 8
Default Macro code to put series name next to individual line in linegrap

Look at this page
http://www.andypope.info/charts/Labellast.htm
Misange

Otani a écrit :
I want to put the series names next to their corresponding line in the line
graph. I remember seeing on the internet that there is a macro code for this
but I cannot find this anymore. Does anyone know what the macro code is?

  #3  
Old February 23rd, 2010, 11:50 AM posted to microsoft.public.excel.charting
Otani
external usenet poster
 
Posts: 4
Default Macro code to put series name next to individual line in line

I have used the VBA code from the John Peltier link at the bottom. The macro
works but for some reason everytime I change the series name in the table,
the legend in the graph would automatically change as well but the label next
to the graph doesn't. I have to run the macro again to see the change takes
effect. My macro setting is already set to enable all so I don't if I have
missed something.

"Misange" wrote:

Look at this page
http://www.andypope.info/charts/Labellast.htm
Misange

Otani a écrit :
I want to put the series names next to their corresponding line in the line
graph. I remember seeing on the internet that there is a macro code for this
but I cannot find this anymore. Does anyone know what the macro code is?

.

  #4  
Old February 23rd, 2010, 07:24 PM posted to microsoft.public.excel.charting
Jon Peltier[_2_]
external usenet poster
 
Posts: 386
Default Macro code to put series name next to individual line in line

The original code created a static label populated by the text that was
the series name when the label was created. Change the series name, the
label does not change.

Modify the ApplyDataLabels command to this:

mySrs.Points(iPts).ApplyDataLabels _
ShowSeriesName:=True, ShowCategoryName:=False, _
ShowValue:=False, AutoText:=False, LegendKey:=False

The label now explicitly shows the series name. Change the series name,
and the label itself changes.

I updated the tutorial when Excel 2007 misbehaved. The new version works
in all versions, and includes the above enhancement:

Label Last Point for Excel 2007 » Peltier Tech Blog
http://peltiertech.com/WordPress/lab...or-excel-2007/

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
774-275-0064
http://peltiertech.com/


On 2/23/2010 6:50 AM, Otani wrote:
I have used the VBA code from the John Peltier link at the bottom. The macro
works but for some reason everytime I change the series name in the table,
the legend in the graph would automatically change as well but the label next
to the graph doesn't. I have to run the macro again to see the change takes
effect. My macro setting is already set to enable all so I don't if I have
missed something.

"Misange" wrote:

Look at this page
http://www.andypope.info/charts/Labellast.htm
Misange

Otani a écrit :
I want to put the series names next to their corresponding line in the line
graph. I remember seeing on the internet that there is a macro code for this
but I cannot find this anymore. Does anyone know what the macro code is?

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.