<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Label Each Series in a Chart</title>
	<atom:link href="http://peltiertech.com/WordPress/label-each-series-in-a-chart/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/</link>
	<description>PTS Excel Charts and Tutorials Blog</description>
	<lastBuildDate>Sat, 21 Nov 2009 04:01:08 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-15220</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 16 Jun 2009 21:04:34 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-15220</guid>
		<description>Barrett -

I turned on the macro recorder while making some minor adjustments and came up with this modified procedure (note the red text). It doesn&#039;t do the number format, since it assumes the series name is a string, but if you format the series names the way you want, it should work.

&lt;pre class=&quot;vbasmall&quot;&gt;Sub LabelLastPoint()
  Dim mySrs As Series
  Dim iPts As Long
  Dim bLabeled As Boolean
  If ActiveChart Is Nothing Then
    MsgBox &quot;Select a chart and try again.&quot;, vbExclamation
  Else
    For Each mySrs In ActiveChart.SeriesCollection
      bLabeled = False
      With mySrs
        For iPts = .Points.count To 1 Step -1
          If bLabeled Then
            &#039; handle error if point isn&#039;t plotted
            On Error Resume Next
            &#039; remove existing label if it&#039;s not the last point
            mySrs.Points(iPts).HasDataLabel = False
            On Error GoTo 0
          Else
            &#039; handle error if point isn&#039;t plotted
            On Error Resume Next
            &#039; add label
            mySrs.Points(iPts).ApplyDataLabels _
                ShowSeriesName:=True, _
                ShowCategoryName:=False, ShowValue:=False, _
                AutoText:=True, LegendKey:=False
&lt;font color=&quot;red&quot;&gt;            With mySrs.Points(iPts).DataLabel
              .Position = xlLabelPositionCenter
              .Orientation = xlUpward
            End With&lt;/font&gt;
            bLabeled = (Err.Number = 0)
            On Error GoTo 0
          End If
        Next
      End With
    Next
    ActiveChart.HasLegend = False
  End If
End Sub
&#160;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Barrett -</p>
<p>I turned on the macro recorder while making some minor adjustments and came up with this modified procedure (note the red text). It doesn&#8217;t do the number format, since it assumes the series name is a string, but if you format the series names the way you want, it should work.</p>
<pre class="vbasmall">Sub LabelLastPoint()
  Dim mySrs As Series
  Dim iPts As Long
  Dim bLabeled As Boolean
  If ActiveChart Is Nothing Then
    MsgBox "Select a chart and try again.", vbExclamation
  Else
    For Each mySrs In ActiveChart.SeriesCollection
      bLabeled = False
      With mySrs
        For iPts = .Points.count To 1 Step -1
          If bLabeled Then
            ' handle error if point isn't plotted
            On Error Resume Next
            ' remove existing label if it's not the last point
            mySrs.Points(iPts).HasDataLabel = False
            On Error GoTo 0
          Else
            ' handle error if point isn't plotted
            On Error Resume Next
            ' add label
            mySrs.Points(iPts).ApplyDataLabels _
                ShowSeriesName:=True, _
                ShowCategoryName:=False, ShowValue:=False, _
                AutoText:=True, LegendKey:=False
<font color="red">            With mySrs.Points(iPts).DataLabel
              .Position = xlLabelPositionCenter
              .Orientation = xlUpward
            End With</font>
            bLabeled = (Err.Number = 0)
            On Error GoTo 0
          End If
        Next
      End With
    Next
    ActiveChart.HasLegend = False
  End If
End Sub
&nbsp;</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barrett</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-15213</link>
		<dc:creator>Barrett</dc:creator>
		<pubDate>Tue, 16 Jun 2009 17:28:43 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-15213</guid>
		<description>Hi Jon,

I&#039;m wondering how to rotate the data labels 270 degrees using vba, as well as format the data labels to a certain category (Accounting), with 0 decimal places.

Even when I do this manually to a data label, I then have to move the label down so it lays within the column of data.  I&#039;m sure there is a way to do this as well, but am at a loss.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>I&#8217;m wondering how to rotate the data labels 270 degrees using vba, as well as format the data labels to a certain category (Accounting), with 0 decimal places.</p>
<p>Even when I do this manually to a data label, I then have to move the label down so it lays within the column of data.  I&#8217;m sure there is a way to do this as well, but am at a loss.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LEM</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-8037</link>
		<dc:creator>LEM</dc:creator>
		<pubDate>Thu, 08 Jan 2009 18:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-8037</guid>
		<description>Thank you Jon!  And I appreciate your quick response!!</description>
		<content:encoded><![CDATA[<p>Thank you Jon!  And I appreciate your quick response!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-8034</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 08 Jan 2009 16:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-8034</guid>
		<description>LEM -

You need to change one line of code:

&lt;pre class=&quot;vba&quot;&gt;    &#039; add label
    mySrs.Points(iPts).ApplyDataLabels AutoText:=True, _
        LegendKey:=False, ShowSeriesName:=True, ShowValue:=True, _
        Separator:=&quot;&quot; &amp; Chr(10) &amp; &quot;&quot;&lt;/vba&gt;

Chr(10) puts the value onto a new line, that is, separates it with a line feed (ASCII character 10). A little testing shows you can use any string you want, even multiple characters as the separator. I tried these and all did as expected:

Separator:=&quot;, &quot;
Separator:=&quot; - &quot;
Separator:=&quot; ### &quot;</description>
		<content:encoded><![CDATA[<p>LEM -</p>
<p>You need to change one line of code:</p>
<pre class="vba">    ' add label
    mySrs.Points(iPts).ApplyDataLabels AutoText:=True, _
        LegendKey:=False, ShowSeriesName:=True, ShowValue:=True, _
        Separator:="" &#038; Chr(10) &#038; ""

Chr(10) puts the value onto a new line, that is, separates it with a line feed (ASCII character 10). A little testing shows you can use any string you want, even multiple characters as the separator. I tried these and all did as expected:

Separator:=", "
Separator:=" - "
Separator:=" ### "</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: LEM</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-8032</link>
		<dc:creator>LEM</dc:creator>
		<pubDate>Thu, 08 Jan 2009 16:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-8032</guid>
		<description>Hello Jon,

I have entered this into a workbook, and I am getting the series name, but I was wondering how to alter the code so that I can have the series name and the value.  Any help would be greatly appreciated!

Thanks!</description>
		<content:encoded><![CDATA[<p>Hello Jon,</p>
<p>I have entered this into a workbook, and I am getting the series name, but I was wondering how to alter the code so that I can have the series name and the value.  Any help would be greatly appreciated!</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-5811</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sat, 01 Nov 2008 00:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-5811</guid>
		<description>Stružák - 

Good point. I usually remember. In this case it probably wouldn&#039;t make too much difference, but it&#039;s a good habit to get into.</description>
		<content:encoded><![CDATA[<p>Stružák &#8211; </p>
<p>Good point. I usually remember. In this case it probably wouldn&#8217;t make too much difference, but it&#8217;s a good habit to get into.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stružák</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-5803</link>
		<dc:creator>Stružák</dc:creator>
		<pubDate>Fri, 31 Oct 2008 21:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-5803</guid>
		<description>What about adding Application.ScreenUpdating = False at the beggining of the macro and Application.ScreenUpdating = True at the end? Not a crucial thing, but it might speed up the procedure.</description>
		<content:encoded><![CDATA[<p>What about adding Application.ScreenUpdating = False at the beggining of the macro and Application.ScreenUpdating = True at the end? Not a crucial thing, but it might speed up the procedure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-5486</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 22 Oct 2008 11:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-5486</guid>
		<description>Petr -

IMO, leader lines do not add to a chart, they seem to add clutter. If you need leader lines to clarify which label corresponds to which series, you may be dealing with excessive clutter. When I am almost cluttered enough to use leader lines, I try to rely instead on coloring the label text to match the series format.

That said, you could in fact use VBA to simplify the task of adding leader lines. I would extend the series by one point, remove the last marker and change the last line segment to a leader line kind of format (thin line, different format from the series lines) and center the label on the added point. You could do this manually, and see if you like it, if so, automate it.</description>
		<content:encoded><![CDATA[<p>Petr -</p>
<p>IMO, leader lines do not add to a chart, they seem to add clutter. If you need leader lines to clarify which label corresponds to which series, you may be dealing with excessive clutter. When I am almost cluttered enough to use leader lines, I try to rely instead on coloring the label text to match the series format.</p>
<p>That said, you could in fact use VBA to simplify the task of adding leader lines. I would extend the series by one point, remove the last marker and change the last line segment to a leader line kind of format (thin line, different format from the series lines) and center the label on the added point. You could do this manually, and see if you like it, if so, automate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petr</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-5480</link>
		<dc:creator>Petr</dc:creator>
		<pubDate>Wed, 22 Oct 2008 09:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-5480</guid>
		<description>Very nice, Jon. 
Still, have you ever pondered on a greater luxury: automatic connecting line between (the last) point and its label? What is your tentative opinion - would it be even soluble by VBA means?

Petr</description>
		<content:encoded><![CDATA[<p>Very nice, Jon.<br />
Still, have you ever pondered on a greater luxury: automatic connecting line between (the last) point and its label? What is your tentative opinion &#8211; would it be even soluble by VBA means?</p>
<p>Petr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/label-each-series-in-a-chart/comment-page-1/#comment-5442</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 21 Oct 2008 19:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=714#comment-5442</guid>
		<description>Jaanus - Good idea. I missed it because I probably allready deleted the legend, but I&#039;ve added it to the code above.</description>
		<content:encoded><![CDATA[<p>Jaanus &#8211; Good idea. I missed it because I probably allready deleted the legend, but I&#8217;ve added it to the code above.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
