<?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: Update Regular Chart when Pivot Table Updates</title>
	<atom:link href="http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Fri, 10 Feb 2012 23:37:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Bryan Marks</title>
		<link>http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/comment-page-1/#comment-78521</link>
		<dc:creator>Bryan Marks</dc:creator>
		<pubDate>Wed, 16 Mar 2011 20:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=153#comment-78521</guid>
		<description>Thanks for answering so quickly!  Unfortunately, I still have some questions due to my ignorance of macros and VBA:  

1.  Those two lines of code are already included in the big macro at the top of this post, so does adding them again to the bottom of the macro fix things?

2.  I ran a compile on the following code and received an error message saying it was an invalid use of the Me keyword.

3.  I&#039;m afraid I still don&#039;t understand what indexes reference.  What does &quot;the index of the chart reference&quot; and &quot;the index of the pivot table&quot; mean?

4.  Is my problem that the pivot tables are all based on the exact same source data?

5.  I hate to ask, but can you put the macro together as it should appear to only update the specific charts associated with a specific pivot table?

Thanks again!

Bryan</description>
		<content:encoded><![CDATA[<p>Thanks for answering so quickly!  Unfortunately, I still have some questions due to my ignorance of macros and VBA:  </p>
<p>1.  Those two lines of code are already included in the big macro at the top of this post, so does adding them again to the bottom of the macro fix things?</p>
<p>2.  I ran a compile on the following code and received an error message saying it was an invalid use of the Me keyword.</p>
<p>3.  I&#8217;m afraid I still don&#8217;t understand what indexes reference.  What does &#8220;the index of the chart reference&#8221; and &#8220;the index of the pivot table&#8221; mean?</p>
<p>4.  Is my problem that the pivot tables are all based on the exact same source data?</p>
<p>5.  I hate to ask, but can you put the macro together as it should appear to only update the specific charts associated with a specific pivot table?</p>
<p>Thanks again!</p>
<p>Bryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/comment-page-1/#comment-78520</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 16 Mar 2011 20:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=153#comment-78520</guid>
		<description>Bryan -

Right after the sentence you cited, there are two lines of code:

Set cht = ActiveSheet.ChartObjects(1).Chart 
Set pt = ActiveSheet.PivotTables(1)

the indexes are the &quot;(1)&quot; in these commands, one for index of the chart object, the other for the index of the pivot table. It might be more robust to name the chart and the pivot table.</description>
		<content:encoded><![CDATA[<p>Bryan -</p>
<p>Right after the sentence you cited, there are two lines of code:</p>
<p>Set cht = ActiveSheet.ChartObjects(1).Chart<br />
Set pt = ActiveSheet.PivotTables(1)</p>
<p>the indexes are the &#8220;(1)&#8221; in these commands, one for index of the chart object, the other for the index of the pivot table. It might be more robust to name the chart and the pivot table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Marks</title>
		<link>http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/comment-page-1/#comment-78466</link>
		<dc:creator>Bryan Marks</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=153#comment-78466</guid>
		<description>I have a series of graphs on different worksheets.  Each graph is based on a different pivot table.  I&#039;m trying to make it so that each graph will automatically be updated if any changes are made to the specific pivot table to which it is tied.  For example, the pivot table contains data for all 50 states over ten years.  I&#039;d like to see the graph update if someone selects one or multiple states in the pivot table without repeating that exercise by clicking on the graph itself.

I tried using the first macro and then the one below so that only the graph on the same page as the pivot table gets updated, but what is happening is that ALL graphs are getting updated using the same single pivot table data.  This is obviously not what I want to happen.  

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
  Application.EnableEvents = False

  If Target.Name = Me.PivotTables(1).Name Then
    UpdateChartFromPivotTable
  End If

  Application.EnableEvents = True
End Sub

Unfortunately, I didn&#039;t understand what you meant with this statement, but this would appear to fix the problem I&#039;m having now:  &quot;You could further modify the code to update different charts which are based on different pivot tables. Modify the indexes in these lines, instead of using “1″.&quot;  To what do the indexes refer?

Thanks for your help!

Bryan</description>
		<content:encoded><![CDATA[<p>I have a series of graphs on different worksheets.  Each graph is based on a different pivot table.  I&#8217;m trying to make it so that each graph will automatically be updated if any changes are made to the specific pivot table to which it is tied.  For example, the pivot table contains data for all 50 states over ten years.  I&#8217;d like to see the graph update if someone selects one or multiple states in the pivot table without repeating that exercise by clicking on the graph itself.</p>
<p>I tried using the first macro and then the one below so that only the graph on the same page as the pivot table gets updated, but what is happening is that ALL graphs are getting updated using the same single pivot table data.  This is obviously not what I want to happen.  </p>
<p>Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)<br />
  Application.EnableEvents = False</p>
<p>  If Target.Name = Me.PivotTables(1).Name Then<br />
    UpdateChartFromPivotTable<br />
  End If</p>
<p>  Application.EnableEvents = True<br />
End Sub</p>
<p>Unfortunately, I didn&#8217;t understand what you meant with this statement, but this would appear to fix the problem I&#8217;m having now:  &#8220;You could further modify the code to update different charts which are based on different pivot tables. Modify the indexes in these lines, instead of using “1″.&#8221;  To what do the indexes refer?</p>
<p>Thanks for your help!</p>
<p>Bryan</p>
]]></content:encoded>
	</item>
</channel>
</rss>

