<?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: VBA Conditional Formatting of Charts by Value</title>
	<atom:link href="http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/</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/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-15006</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 10 Jun 2009 02:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-15006</guid>
		<description>That could be made faster by turning off screen updating while it works:

&lt;pre class=&quot;vbasmall&quot;&gt;Sub ColorByValue()
  Dim rPatterns As Range
  Dim iPattern As Long
  Dim vPatterns As Variant
  Dim iPoint As Long
  Dim vValues As Variant
  Dim rValue As Range
  Dim srs As Series

  &lt;span style=&quot;color: blue;&quot;&gt;Application.ScreenUpdating = False&lt;/span&gt;
  Set rPatterns = ActiveSheet.Range(&quot;A1:A4&quot;)
  vPatterns = rPatterns.Value
  For Each srs In ActiveChart.SeriesCollection
    With srs
      vValues = .Values
      For iPoint = 1 To UBound(vValues)
        For iPattern = 1 To UBound(vPatterns)
          If vValues(iPoint) &lt;= vPatterns(iPattern, 1) Then
            .Points(iPoint).Interior.ColorIndex = _
                rPatterns.Cells(iPattern, 1).Interior.ColorIndex
            Exit For
          End If
        Next
      Next
    End With
  Next
  &lt;span style=&quot;color: blue;&quot;&gt;Application.ScreenUpdating = True&lt;/span&gt;
End Sub&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>That could be made faster by turning off screen updating while it works:</p>
<pre class="vbasmall">Sub ColorByValue()
  Dim rPatterns As Range
  Dim iPattern As Long
  Dim vPatterns As Variant
  Dim iPoint As Long
  Dim vValues As Variant
  Dim rValue As Range
  Dim srs As Series

  <span style="color: blue;">Application.ScreenUpdating = False</span>
  Set rPatterns = ActiveSheet.Range("A1:A4")
  vPatterns = rPatterns.Value
  For Each srs In ActiveChart.SeriesCollection
    With srs
      vValues = .Values
      For iPoint = 1 To UBound(vValues)
        For iPattern = 1 To UBound(vPatterns)
          If vValues(iPoint) &lt;= vPatterns(iPattern, 1) Then
            .Points(iPoint).Interior.ColorIndex = _
                rPatterns.Cells(iPattern, 1).Interior.ColorIndex
            Exit For
          End If
        Next
      Next
    End With
  Next
  <span style="color: blue;">Application.ScreenUpdating = True</span>
End Sub</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Dillon</title>
		<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-15000</link>
		<dc:creator>Ross Dillon</dc:creator>
		<pubDate>Tue, 09 Jun 2009 22:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-15000</guid>
		<description>Thanks, I figured that would do it but while I&#039;m good at reading code, I&#039;m not so good at creating it!

As for the colors, It&#039;s only the A4 green that doesn&#039;t come out correctly.  So I created a green default template chart and ingore the forth loop (if it belongs green, it won&#039;t change it).  Reduces run time by 25% also :)</description>
		<content:encoded><![CDATA[<p>Thanks, I figured that would do it but while I&#8217;m good at reading code, I&#8217;m not so good at creating it!</p>
<p>As for the colors, It&#8217;s only the A4 green that doesn&#8217;t come out correctly.  So I created a green default template chart and ingore the forth loop (if it belongs green, it won&#8217;t change it).  Reduces run time by 25% also :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-14999</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 09 Jun 2009 21:57:48 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-14999</guid>
		<description>Ross -

You need another link to loop through each series:

&lt;pre class=&quot;vbasmall&quot;&gt;Sub ColorByValue()
  Dim rPatterns As Range
  Dim iPattern As Long
  Dim vPatterns As Variant
  Dim iPoint As Long
  Dim vValues As Variant
  Dim rValue As Range
  Dim srs As Series

  Set rPatterns = ActiveSheet.Range(&quot;A1:A4&quot;)
  vPatterns = rPatterns.Value
  &lt;span style=&quot;color: blue;&quot;&gt;For Each srs In ActiveChart.SeriesCollection
    With srs&lt;/span&gt;
      vValues = .Values
      For iPoint = 1 To UBound(vValues)
        For iPattern = 1 To UBound(vPatterns)
          If vValues(iPoint) &lt;= vPatterns(iPattern, 1) Then
            .Points(iPoint).Interior.ColorIndex = _
                rPatterns.Cells(iPattern, 1).Interior.ColorIndex
            Exit For
          End If
        Next
      Next
    End With
  &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;
End Sub&lt;/pre&gt;

If the color index commands don&#039;t work, you could try replacing .ColorIndex by .Color (color index worked for me).</description>
		<content:encoded><![CDATA[<p>Ross -</p>
<p>You need another link to loop through each series:</p>
<pre class="vbasmall">Sub ColorByValue()
  Dim rPatterns As Range
  Dim iPattern As Long
  Dim vPatterns As Variant
  Dim iPoint As Long
  Dim vValues As Variant
  Dim rValue As Range
  Dim srs As Series

  Set rPatterns = ActiveSheet.Range("A1:A4")
  vPatterns = rPatterns.Value
  <span style="color: blue;">For Each srs In ActiveChart.SeriesCollection
    With srs</span>
      vValues = .Values
      For iPoint = 1 To UBound(vValues)
        For iPattern = 1 To UBound(vPatterns)
          If vValues(iPoint) &lt;= vPatterns(iPattern, 1) Then
            .Points(iPoint).Interior.ColorIndex = _
                rPatterns.Cells(iPattern, 1).Interior.ColorIndex
            Exit For
          End If
        Next
      Next
    End With
  <span style="color: blue;">Next</span>
End Sub</pre>
<p>If the color index commands don&#8217;t work, you could try replacing .ColorIndex by .Color (color index worked for me).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Dillon</title>
		<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-14997</link>
		<dc:creator>Ross Dillon</dc:creator>
		<pubDate>Tue, 09 Jun 2009 21:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-14997</guid>
		<description>Please refer to this image &lt;a href=&quot;http://rossdillon.smugmug.com/photos/559288016_7kLZN-O-2.jpg&quot; rel=&quot;nofollow&quot;&gt;http://rossdillon.smugmug.com/photos/559288016_7kLZN-O-2.jpg&lt;/a&gt;.

Some points about the graph before the question.  It&#039;s critical for my purpose that each slice appear to be 1/8 of each ring (each represent an azimuth angle around an airplane).  The trick was to set the value of each cell to &quot;1&quot; plus the actual value divided by 1000.  That makes the difference between slices so minimal that the rings appear to be equally spaced.  The hope is to then shade each slice as shown in range (I1:I4) which was the only change I made to the VBA subroutine

I also rotated the data so the zero azimuth is pointed to the right, and X-1 is the inner ring.

I&#039;m using this routine with the referenced donut chart and it runs OK but only changes the colors of the inner ring (I think that&#039;s because of the line &quot;With ActiveChart.SeriesCollection(1)&quot; which I don&#039;t recall how to fix to include every SeriesCollection).  But, the colors did not match the defined region (I1:I4) nor did they follow any pattern regarding the values.  

One thing that has me concerned is after I started I found in the Help file that this works for graphs such that &quot;You don&#039;t have more than seven categories per data series&quot; which I do...but the chart was created successfully.  Why this restriction?  What does in impact (since I created one OK)?

Help?</description>
		<content:encoded><![CDATA[<p>Please refer to this image <a href="http://rossdillon.smugmug.com/photos/559288016_7kLZN-O-2.jpg" rel="nofollow">http://rossdillon.smugmug.com/photos/559288016_7kLZN-O-2.jpg</a>.</p>
<p>Some points about the graph before the question.  It&#8217;s critical for my purpose that each slice appear to be 1/8 of each ring (each represent an azimuth angle around an airplane).  The trick was to set the value of each cell to &#8220;1&#8243; plus the actual value divided by 1000.  That makes the difference between slices so minimal that the rings appear to be equally spaced.  The hope is to then shade each slice as shown in range (I1:I4) which was the only change I made to the VBA subroutine</p>
<p>I also rotated the data so the zero azimuth is pointed to the right, and X-1 is the inner ring.</p>
<p>I&#8217;m using this routine with the referenced donut chart and it runs OK but only changes the colors of the inner ring (I think that&#8217;s because of the line &#8220;With ActiveChart.SeriesCollection(1)&#8221; which I don&#8217;t recall how to fix to include every SeriesCollection).  But, the colors did not match the defined region (I1:I4) nor did they follow any pattern regarding the values.  </p>
<p>One thing that has me concerned is after I started I found in the Help file that this works for graphs such that &#8220;You don&#8217;t have more than seven categories per data series&#8221; which I do&#8230;but the chart was created successfully.  Why this restriction?  What does in impact (since I created one OK)?</p>
<p>Help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-14743</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Mon, 01 Jun 2009 15:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-14743</guid>
		<description>Valerie -

If the green/red transition occurs at zero, you could try &lt;a href=&quot;http://peltiertech.com/Excel/ChartsHowTo/InvertIfNegative.html&quot; rel=&quot;nofollow&quot;&gt;Invert if Negative&lt;/a&gt;. If the transition is at a non-zero value, which sounds like your case, you can try &lt;a href=&quot;http://peltiertech.com/Excel/Charts/ConditionalChart1.html&quot; rel=&quot;nofollow&quot;&gt;Simple Conditional Charts&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Valerie -</p>
<p>If the green/red transition occurs at zero, you could try <a href="http://peltiertech.com/Excel/ChartsHowTo/InvertIfNegative.html" rel="nofollow">Invert if Negative</a>. If the transition is at a non-zero value, which sounds like your case, you can try <a href="http://peltiertech.com/Excel/Charts/ConditionalChart1.html" rel="nofollow">Simple Conditional Charts</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valerie</title>
		<link>http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/comment-page-1/#comment-14741</link>
		<dc:creator>Valerie</dc:creator>
		<pubDate>Mon, 01 Jun 2009 15:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/03/vba-conditional-formatting-of-charts-by-value/#comment-14741</guid>
		<description>I&#039;m trying to create bar graphs where the bar (for each month of the year x axis) changes color (green above flat budget $/unit) or (red below flat budget $/unit).  Does anyone know how to do this?  I also have a another chart where the budget volume is different by month and would like the bar for actual volume by month to change to red or green depending if the actual volume is higher/lower than the budget volume for the month.  Any suggestions would be appreciated.</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to create bar graphs where the bar (for each month of the year x axis) changes color (green above flat budget $/unit) or (red below flat budget $/unit).  Does anyone know how to do this?  I also have a another chart where the budget volume is different by month and would like the bar for actual volume by month to change to red or green depending if the actual volume is higher/lower than the budget volume for the month.  Any suggestions would be appreciated.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
