<?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: Dynamic Chart Source Data</title>
	<atom:link href="http://peltiertech.com/WordPress/dynamic-chart-source-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Tue, 22 May 2012 11:00:35 +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: Niel</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-222998</link>
		<dc:creator>Niel</dc:creator>
		<pubDate>Mon, 21 May 2012 17:36:25 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-222998</guid>
		<description>Thank you! Thank you. Works like a charm.</description>
		<content:encoded><![CDATA[<p>Thank you! Thank you. Works like a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-222830</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Mon, 21 May 2012 11:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-222830</guid>
		<description>Mark -

That means you&#039;re trying to reference an item in a collection that doesn&#039;t exist. Do you have a chart named (&quot;Chart 10&quot;) on the active sheet? Is there a workbook named &quot;1205 WorkQueue Pivots May-12.xlsm&quot;, which has a sheet named &quot;DPD&quot;, and which includes a range named &quot;ChtSourceData&quot;?</description>
		<content:encoded><![CDATA[<p>Mark -</p>
<p>That means you&#8217;re trying to reference an item in a collection that doesn&#8217;t exist. Do you have a chart named (&#8220;Chart 10&#8243;) on the active sheet? Is there a workbook named &#8220;1205 WorkQueue Pivots May-12.xlsm&#8221;, which has a sheet named &#8220;DPD&#8221;, and which includes a range named &#8220;ChtSourceData&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Sheridan</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-222705</link>
		<dc:creator>Mark Sheridan</dc:creator>
		<pubDate>Mon, 21 May 2012 03:17:12 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-222705</guid>
		<description>Hi Jon

I get a Subscript Out Of Range error when I use this code in my DPD worksheet:

Sub UpdateChartSourceData4()
Charts(&quot;Chart 10&quot;).SetSourceData _
Source:=Workbooks(&quot;1205 WorkQueue Pivots May-12.xlsm&quot;).Worksheets(&quot;DPD&quot;).Range(&quot;ChtSourceData&quot;), _
PlotBy:=xlColumns
End Sub

ChtSourceData =OFFSET(DPD!$M$4,0,0,COUNTA(DPD!$M:$M)+1,COUNTA(DPD!$2:$2)+6)

Can you help?

Thanks

Mark</description>
		<content:encoded><![CDATA[<p>Hi Jon</p>
<p>I get a Subscript Out Of Range error when I use this code in my DPD worksheet:</p>
<p>Sub UpdateChartSourceData4()<br />
Charts(&#8220;Chart 10&#8243;).SetSourceData _<br />
Source:=Workbooks(&#8220;1205 WorkQueue Pivots May-12.xlsm&#8221;).Worksheets(&#8220;DPD&#8221;).Range(&#8220;ChtSourceData&#8221;), _<br />
PlotBy:=xlColumns<br />
End Sub</p>
<p>ChtSourceData =OFFSET(DPD!$M$4,0,0,COUNTA(DPD!$M:$M)+1,COUNTA(DPD!$2:$2)+6)</p>
<p>Can you help?</p>
<p>Thanks</p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-220292</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 16 May 2012 18:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-220292</guid>
		<description>Niel -

1. What are the error messages?

2. This procedure goes in the worksheet with the data. Use the keyword &quot;Me&quot; for the sheet containing the VBA code. You need to specify the chart:

&lt;pre class=&quot;vbasmall&quot;&gt;&lt;code&gt;Private Sub Worksheet_Calculate()
  With Worksheets(&quot;The Chart&quot;).ChartObjects(&quot;Chart 4&quot;).Chart
    With .Axes(xlCategory)
      &#039; only change it if it needs changing
      If .MinimumScale &lt;&gt; Me.Range(&quot;B94&quot;).Value Then
        .MinimumScale = Me.Range(&quot;B94&quot;).Value
      End If
      &#039; etc. for MaximumScale and MajorUnit
    End With
    With .Axes(xlValue)
      &#039; etc. for Value axis
    End With
  End With
End Sub&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Niel -</p>
<p>1. What are the error messages?</p>
<p>2. This procedure goes in the worksheet with the data. Use the keyword &#8220;Me&#8221; for the sheet containing the VBA code. You need to specify the chart:</p>
<pre class="vbasmall"><code>Private Sub Worksheet_Calculate()
  With Worksheets("The Chart").ChartObjects("Chart 4").Chart
    With .Axes(xlCategory)
      ' only change it if it needs changing
      If .MinimumScale &lt;&gt; Me.Range("B94").Value Then
        .MinimumScale = Me.Range("B94").Value
      End If
      ' etc. for MaximumScale and MajorUnit
    End With
    With .Axes(xlValue)
      ' etc. for Value axis
    End With
  End With
End Sub</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niel</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-220236</link>
		<dc:creator>Niel</dc:creator>
		<pubDate>Wed, 16 May 2012 16:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-220236</guid>
		<description>Jon, 

Thanks for getting back to me quickly. The only problem I think I am having is 

1. When I Open and Close or work on another Excel file I get debug errors. I thought the code was private worksheet and is inserted specifically on the sheet where the chart is. So I don&#039;t understand why working on another file or tab gives me a debug error.

2. I have a similar chart in sheet 2 and which changes based on changes in sheet 1. So i guess i cannot use activesheet in this case the second sheet is not active while i am looking at the first.</description>
		<content:encoded><![CDATA[<p>Jon, </p>
<p>Thanks for getting back to me quickly. The only problem I think I am having is </p>
<p>1. When I Open and Close or work on another Excel file I get debug errors. I thought the code was private worksheet and is inserted specifically on the sheet where the chart is. So I don&#8217;t understand why working on another file or tab gives me a debug error.</p>
<p>2. I have a similar chart in sheet 2 and which changes based on changes in sheet 1. So i guess i cannot use activesheet in this case the second sheet is not active while i am looking at the first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/dynamic-chart-source-data/comment-page-2/#comment-219945</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 16 May 2012 01:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=136#comment-219945</guid>
		<description>Niel -

In this case, you need to use the Worksheet_Calculate event.

&lt;pre class=&quot;vbasmall&quot;&gt;&lt;code&gt;Private Sub Worksheet_Calculate()
  With ActiveSheet.ChartObjects(&quot;Chart 4&quot;).Chart
    With .Axes(xlCategory)
      &#039; only change it if it needs changing
      If .MinimumScale &lt;&gt; ActiveSheet.Range(&quot;B94&quot;).Value Then
        .MinimumScale = ActiveSheet.Range(&quot;B94&quot;).Value
      End If
      &#039; etc. for MaximumScale and MajorUnit
    End With
    With .Axes(xlValue)
      &#039; etc. for Value axis
    End With
  End With
End Sub&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Niel -</p>
<p>In this case, you need to use the Worksheet_Calculate event.</p>
<pre class="vbasmall"><code>Private Sub Worksheet_Calculate()
  With ActiveSheet.ChartObjects("Chart 4").Chart
    With .Axes(xlCategory)
      ' only change it if it needs changing
      If .MinimumScale <> ActiveSheet.Range("B94").Value Then
        .MinimumScale = ActiveSheet.Range("B94").Value
      End If
      ' etc. for MaximumScale and MajorUnit
    End With
    With .Axes(xlValue)
      ' etc. for Value axis
    End With
  End With
End Sub</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>

