<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bacon Bits: &#187; Visualization</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/tag/visualization/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:56:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Formatting Access Queries to the Thousands Place</title>
		<link>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 12:03:30 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Queries]]></category>
		<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/</guid>
		<description><![CDATA[In an Email last week, Christina asks: &#8220;Do you know of an easy way to show Access query results in thousands? Thanks DataPig.You are the like that black bird on Angry Birds – the bomb.&#8221; Ok….so I added that last sentence. But Christina did ask a pretty good question. . Here&#8217;s how you can format [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/' rel='bookmark' title='Replacing the Microsoft Access Splash Screen'>Replacing the Microsoft Access Splash Screen</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In an Email last week, Christina asks:
</p>
<p><em>&#8220;Do you know of an easy way to show Access query results in thousands?<br />
Thanks DataPig.You are the like that black bird on Angry Birds – the bomb.&#8221;<br />
</em></p>
<p>Ok….so I added that last sentence.  But Christina did ask a pretty good question.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>Here&#8217;s how you can format Access query fields so that they show as thousands.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>You first start with a working query.  As you can see, this query shows revenue by market with an indication of how much of that revenue comes from Internet Sales.  You&#8217;ll notice that the revenue columns inundate you with lots of numbers.  That is to say, the revenue columns are difficult to read.   Showing these columns in thousands would help readability.<br />
<span id="more-3506"></span>
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Go into Design View and right click on the query field you want to format.
</p>
<p>This will pull up a context menu where you can select Properties.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>In the Property Sheet dialog box, you will see the Format property.
</p>
<p>Here, you can enter any format syntax you would like.  In this case, we want to enter a format string that will give us numbers in the thousands place.  So we enter <strong>$#,###,</strong>.<strong><br/><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA3.png" alt=""/><br />
		</strong></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Once we save and run the query again, we can see that the numbers are in thousands place – making them much easier to read.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA4.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Access can handle pretty much any number formatting Excel can.  So you can get just as fancy in Access as you can in Excel.
</p>
<p>For example, I can get fancy and add a &#8220;k&#8221; indicator to all the revenue numbers by changing the format string to this:  <strong>$#,###, &#8220;k&#8221;</strong>.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA5.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>And remember, this formatting trick can be applied to Forms and Reports also (simply apply the formatting to their respective Format properties).
</p>
<p><span style="color:white">.<br />
</span></p>
<p>There you have it Christina.  I hope that helped. </p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/' rel='bookmark' title='Replacing the Microsoft Access Splash Screen'>Replacing the Microsoft Access Splash Screen</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Pivot Slicers as Form Controls</title>
		<link>http://datapigtechnologies.com/blog/index.php/use-pivot-slicers-as-form-controls/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/use-pivot-slicers-as-form-controls/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 10:30:17 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel Charts]]></category>
		<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[PivotTables]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3415</guid>
		<description><![CDATA[About a week ago, Bill Jelen sent me an email with a challenge to figure out the nifty trick he shows in this YouTube Video. Inspired by the video, I decided to use the trick in a simple dashboard model. . What I ended up with is this cool technique that allows me to replace [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/cut-the-size-of-your-pivot-table-workbooks-in-half/' rel='bookmark' title='Cut the Size of Your Pivot Table Workbooks in Half'>Cut the Size of Your Pivot Table Workbooks in Half</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/showing-multiple-pivot-table-subtotals-for-one-field/' rel='bookmark' title='Showing Multiple Pivot Table Subtotals for One Field'>Showing Multiple Pivot Table Subtotals for One Field</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/forcing-number-formatting-in-a-pivot-table/' rel='bookmark' title='Forcing Number Formatting in a Pivot Table'>Forcing Number Formatting in a Pivot Table</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-a-frequency-distribution-with-a-pivot-table/' rel='bookmark' title='Creating a Frequency Distribution with a Pivot Table'>Creating a Frequency Distribution with a Pivot Table</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/transposing-a-dataset-with-a-pivottable/' rel='bookmark' title='Transposing a Dataset with a PivotTable'>Transposing a Dataset with a PivotTable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>About a week ago, Bill Jelen sent me an email with a challenge to figure out the nifty trick he shows in this <a href="http://youtu.be/ACCtKowENAs" target="_blank">YouTube Video</a>.  Inspired by the video, I decided to use the trick in a simple dashboard model.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>What I ended up with is this cool technique that allows me to replace my old Form Controls with Pivot Slicers.  As I select each slicer, my dashboard responds as it would would if I were using a set of Form Controls.  Keep in mind that the charts and other components in my dashboard are in no way connected to a pivot table.<br />
<span id="more-3415"></span><br />
<object height="400" width="900" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param name="quality" value="high" /><param name="src" value="http://www.datapigtechnologies.com/downloads/SlicerAsFormControl.swf" /><param name="align" value="middle"/><param name="loop" value="true" /><embed height="400" width="900" type="application/x-shockwave-flash" quality="high" align="middle" loop="true" src="http://www.datapigtechnologies.com/downloads/SlicerAsFormControl.swf"></embed></object><br />
 </p>
</p>
<p>In this post, I&#8217;ll walk you through the steps required to set this up.  But, if you want to skip to the punch line, <a href="http://www.datapigtechnologies.com/downloads/PivotSlicersAsDashboardFormControls.xlsx" target="_blank">here is a sample download</a>.
</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:black"><span style="font-size:14pt"><strong>Step 1:</strong></span><br />
		</span></p>
<p><span style="color:black">Create a simple table that holds the names you&#8217;d like for your controls, along with some index numbering.  Once you have that, create a pivot table from it.<br />
</span></p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:black"><span style="font-size:14pt"><strong>Step 2:</strong></span><br />
		</span></p>
<p>On the Insert tab of the Ribbon, you&#8217;ll see the Slicer command.  Click anywhere on your pivot table then choose this Slider command.  This will activate the Insert Slicers dialog box.  Once activated, simply choose the field that holds the <span style="color:black">names you&#8217;d like for your controls.</span>
	</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:black"><span style="font-size:14pt"><strong>Step 3:</strong></span><br />
		</span></p>
<p>At this point, you will have a slicer.  Now, you can right-click the slicer and choose Slicer Settings to activate the Slicer Settings dialog box.  This dialog box provides for a handful of formatting options.
</p>
<p>In this scenario, we would want to remove the word CHART and also remove that filter icon.  To do so, we can uncheck the &#8216;Display Header&#8217; option.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli3.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>At this point we have a clean looking slicer.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli4.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p>So what now?  Well, here is the thing.  We now have a slicer that basically controls a simple pivot table.  As I click on the word <strong>Expense</strong>, the pivot table will filter to show the index number for Expense.
</p>
<p>Here is the interesting bit.  The filtered index number will always show up in the same cell (B3 in this case).  So this cell can now be used as a trigger cell for:  vlookups, matches, offsets, etc.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli5.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>In the example I shown in this screenshot, I&#8217;m using the filtered trigger cell to control the values that are going into my dashboard staging area.
</p>
<p>As I click my slicer on the front end, the formulas here in the back end will respond because the pivot table is getting re-filtered to change the trigger cell.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli6.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:black">The drawback to this technique, of course, is that it can only be used with Excel 2010.<br />
</span></p>
<p><span style="color:black">So if your entire audience is using Excel 2010, this is definitely a nifty trick you can apply to your dashboards.  If half your audience is still on Excel 2007 or 2003, then you&#8217;ll want to stay with your standard form controls.<br />
</span></p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/083011_1030_UsePivotSli7.png" alt=""/>
	</p>
<p>
 </p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/cut-the-size-of-your-pivot-table-workbooks-in-half/' rel='bookmark' title='Cut the Size of Your Pivot Table Workbooks in Half'>Cut the Size of Your Pivot Table Workbooks in Half</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/showing-multiple-pivot-table-subtotals-for-one-field/' rel='bookmark' title='Showing Multiple Pivot Table Subtotals for One Field'>Showing Multiple Pivot Table Subtotals for One Field</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/forcing-number-formatting-in-a-pivot-table/' rel='bookmark' title='Forcing Number Formatting in a Pivot Table'>Forcing Number Formatting in a Pivot Table</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-a-frequency-distribution-with-a-pivot-table/' rel='bookmark' title='Creating a Frequency Distribution with a Pivot Table'>Creating a Frequency Distribution with a Pivot Table</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/transposing-a-dataset-with-a-pivottable/' rel='bookmark' title='Transposing a Dataset with a PivotTable'>Transposing a Dataset with a PivotTable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/use-pivot-slicers-as-form-controls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Color Pie Chart Slices to Match their Source Cells</title>
		<link>http://datapigtechnologies.com/blog/index.php/color-pie-chart-slices-to-match-their-source-cells/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/color-pie-chart-slices-to-match-their-source-cells/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 12:03:34 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel Charts]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3396</guid>
		<description><![CDATA[A few days ago, I posted a macro that will automatically set the series colors in a chart to match their source cell's colors. . After reading my post, Chris Umphlett got inspired to create a macro that automatically sets the data points in a chart to the same color as source cells. . Here's [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A few days ago, <a href="http://datapigtechnologies.com/blog/index.php/automatically-set-chart-series-colors-to-match-source-cell-colors/" target="_blank">I posted a macro</a> that will automatically set the series colors in a chart to match their source cell's colors.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>After reading my post, Chris Umphlett got inspired to create a macro that automatically sets the data points in a chart to  the same color as source cells.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>Here's how it works.<br />
<span id="more-3396"></span><br />
If you were to create the source data for a pie chart, coloring the individual cells as you go…
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/082311_1203_ColorPieCha1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p>…then create a standard pie chart.  You'll get a standard chart.  You'll notice that Excel ignores the cell colors and applies default colors to the data points.
</p>
<p><span style="color:white">.<br />
</span></p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/082311_1203_ColorPieCha2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>But if you then run this macro (which is a slightly altered version of Chris's macro), the macro will color the slices of the pie to match the source cell of each respective data point.
</p>
<p><span style="color:white">.<br />
</span></p>
<p><div class="igBar"><span id="lvb-2"><a href="#" onclick="javascript:showPlainTxt('vb-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-2">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Sub</span> ColorPies<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> cht <span style="color: #b1b100;">As</span> ChartObject</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> i <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> vntValues <span style="color: #b1b100;">As</span> Variant</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> s <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> myseries <span style="color: #b1b100;">As</span> Series</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each cht In ActiveSheet.<span style="color: #66cc66;">ChartObjects</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each myseries In cht.<span style="color: #66cc66;">Chart</span>.<span style="color: #66cc66;">SeriesCollection</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> myseries.<span style="color: #66cc66;">ChartType</span> &lt;&gt; xlPie <span style="color: #b1b100;">Then</span> <span style="color: #b1b100;">GoTo</span> SkipNotPie</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s = <span style="color: #b1b100;">Split</span><span style="color:#006600; font-weight:bold;">&#40;</span>myseries.<span style="color: #66cc66;">Formula</span>, <span style="color: #ff0000;">","</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vntValues = myseries.<span style="color: #66cc66;">Values</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">For</span> i = <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #b1b100;">To</span> <span style="color: #b1b100;">UBound</span><span style="color:#006600; font-weight:bold;">&#40;</span>vntValues<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myseries.<span style="color: #66cc66;">Points</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Interior</span>.<span style="color: #66cc66;">Color</span> = Range<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Cells</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Interior</span>.<span style="color: #66cc66;">Color</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Next</span> i</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SkipNotPie:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Next</span> myseries</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Next</span> cht</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
<p><span style="color:white">.<br />
</span></p>
<p>The result is a nothing short of neato!
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/082311_1203_ColorPieCha3.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p>Just for giggles, I decided to create this small bit of code to chart my Excel color pallet.
</p>
<p>This code will convert my color pallet to a range, color the cells to each respective color in the color pallet and then call the <strong>ColorPies</strong> sub procedure shown above.
</p>
<p><strong>Sub ColorPalletPie()<br/>Dim i As Integer<br/>     For i = 1 To 56<br/>     Cells(i, 1).Interior.ColorIndex = i<br/>     Cells(i, 1).Value = i<br/>Next i<br />
</strong></p>
<p><strong>ActiveSheet.Shapes.AddChart.Select<br/>ActiveChart.ChartType = xlPie<br/>ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:A56")<br/>ActiveChart.SetElement (msoElementLegendTop)<br/>Call ColorPies<br/>End Sub<br />
</strong></p>
<p><span style="color:white"><strong>.<br />
</strong></span></p>
<p>If you have Excel 2007 or 2010, you can run this code to get something like this.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/082311_1203_ColorPieCha4.png" alt=""/><strong><br />
		</strong></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Notes:
</p>
<p>1. To use the <strong>ColorPies</strong> macro, simply copy the code in this post and paste it into a standard module.
</p>
<p>2. As the macro is written, only pie charts will be affected.  You can have this code affect other chart types by removing the line of code that reads <em>If myseries.ChartType &lt;&gt; xlPie Then GoTo SkipNotPie</em>.
</p>
<p>3. In my limited testing, I've confirmed that this macro works in Excel 2003, 2007, 2010.
</p>
<p>4. You can download Chris' original workbook with his code by <a href="http://chrisumphlett.com/?p=168" target="_blank">visiting him at his site</a>.</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/color-pie-chart-slices-to-match-their-source-cells/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Automatically Label First and Last Chart Points</title>
		<link>http://datapigtechnologies.com/blog/index.php/automatically-label-first-and-last-chart-points/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/automatically-label-first-and-last-chart-points/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 11:47:54 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel Charts]]></category>
		<category><![CDATA[Excel VBA]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3364</guid>
		<description><![CDATA[One of the best practices of dashboard building is to avoid overwhelming your customers with too much data at one time - especially in a chart, where they can lose sight of the primary message if focusing on inconsequential data. One of the common ways dashboard designers help focus the message of a chart is [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/automatically-unprotect-sheets-based-on-domain-name/' rel='bookmark' title='Automatically Unprotect Sheets Based on Domain Name'>Automatically Unprotect Sheets Based on Domain Name</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/status-bar-fun-show-cell-selection-info/' rel='bookmark' title='Status Bar Fun – Show Cell Selection Info'>Status Bar Fun – Show Cell Selection Info</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sort-by-color-in-excel-2003/' rel='bookmark' title='Sort by Color in Excel 2003'>Sort by Color in Excel 2003</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the best practices of dashboard building is to avoid overwhelming your customers with too much data at one time - especially in a chart, where they can lose sight of the primary message if focusing on inconsequential data.  One of the common ways dashboard designers help focus the message of a chart is to limit the data labels to only the key points.  </p>
<p><span style="color<br />
:white">.<br />
</span></p>
<p>For example, I can make this chart easier to digest by removing all but the first and last data labels.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081611_1147_Automatical1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p>Once I have only two data labels, my eyes immediately take in the message of this chart (that we went from 11 to 53).<br />
<span id="more-3364"></span>
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081611_1147_Automatical2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p>All that being said, it is a bit of a pain to label just the first and last points in a chart.
</p>
<p>So I wrote a small macro to do just that!
</p>
<p><span style="color:white">.<br />
</span></p>
<p>This macro will alter each chart in the active sheet so that only the first and last data points have labels.  To use this macro, simply copy and paste the code you see here into a standard code module.
</p>
<div class="igBar"><span id="lvb-4"><a href="#" onclick="javascript:showPlainTxt('vb-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-4">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Function</span> FirstAndLastLables<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> oChart <span style="color: #b1b100;">As</span> ChartObject</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> MySeries <span style="color: #b1b100;">As</span> Series</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">For</span> Each oChart In ActiveSheet.<span style="color: #66cc66;">ChartObjects</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each MySeries In oChart.<span style="color: #66cc66;">Chart</span>.<span style="color: #66cc66;">SeriesCollection</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Clear ExistingData Labels</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">ApplyDataLabels</span> <span style="color:#006600; font-weight:bold;">&#40;</span>xlDataLabelsShowNone<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Apply Labels to First and Last Point</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">Points</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">ApplyDataLabels</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">Points</span><span style="color:#006600; font-weight:bold;">&#40;</span>MySeries.<span style="color: #66cc66;">Points</span>.<span style="color: #b1b100;">Count</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">ApplyDataLabels</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">DataLabels</span>.<span style="color: #66cc66;">Font</span>.<span style="color: #66cc66;">Bold</span> = <span style="color: #b1b100;">True</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Make sure label ends up in an appropriate position</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">DataLabels</span>.<span style="color: #66cc66;">Position</span> = xlLabelPositionBestFit</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Next</span> MySeries</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Next</span> oChart</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Function</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/automatically-unprotect-sheets-based-on-domain-name/' rel='bookmark' title='Automatically Unprotect Sheets Based on Domain Name'>Automatically Unprotect Sheets Based on Domain Name</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/status-bar-fun-show-cell-selection-info/' rel='bookmark' title='Status Bar Fun – Show Cell Selection Info'>Status Bar Fun – Show Cell Selection Info</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sort-by-color-in-excel-2003/' rel='bookmark' title='Sort by Color in Excel 2003'>Sort by Color in Excel 2003</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/automatically-label-first-and-last-chart-points/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatically Set Chart Series Colors to Match Source Cell Colors</title>
		<link>http://datapigtechnologies.com/blog/index.php/automatically-set-chart-series-colors-to-match-source-cell-colors/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/automatically-set-chart-series-colors-to-match-source-cell-colors/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 05:53:19 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel Charts]]></category>
		<category><![CDATA[Excel VBA]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3330</guid>
		<description><![CDATA[While working on a dashboarding project here, I accidently developed a charting macro that will automatically set the series colors in a chart to match their source cell's colors. . I'm not sure how useful this actually could be, but it's charming enough to share with my 12 fans. . Let's say I created this [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-format-pivottables-to-match-source-data/' rel='bookmark' title='Auto Format PivotTables to Match Source Data'>Auto Format PivotTables to Match Source Data</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/automatically-unprotect-sheets-based-on-domain-name/' rel='bookmark' title='Automatically Unprotect Sheets Based on Domain Name'>Automatically Unprotect Sheets Based on Domain Name</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/status-bar-fun-show-cell-selection-info/' rel='bookmark' title='Status Bar Fun – Show Cell Selection Info'>Status Bar Fun – Show Cell Selection Info</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/fun-with-custom-lists/' rel='bookmark' title='Fun with Custom Lists'>Fun with Custom Lists</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>While working on a dashboarding project here, I accidently developed a charting macro that will automatically set the series colors in a chart to match their source cell's colors.</p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>I'm not sure how useful this actually could be, but it's charming enough to share with my 12 fans.</p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>Let's say I created this chart – and I want to apply specific coloring to each series without having to painstakingly change all the color options in each series.</p>
<p><span id="more-3330"></span></p>
<p><img alt="" src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081011_0553_Automatical11.png" /></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>All I have to do is color the source cells that feed my chart series….</p>
<p><img alt="" src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081011_0553_Automatical21.png" /></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>…then I run this macro…</p>
<div class="igBar"><span id="lvb-6"><a href="#" onclick="javascript:showPlainTxt('vb-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-6">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Sub</span> CellColorsToChart<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> oChart <span style="color: #b1b100;">As</span> ChartObject</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> MySeries <span style="color: #b1b100;">As</span> Series</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> FormulaSplit <span style="color: #b1b100;">As</span> Variant</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> SourceRange <span style="color: #b1b100;">As</span> Range</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> SourceRangeColor <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'Loop through all charts in the active sheet</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">For</span> Each oChart In ActiveSheet.<span style="color: #66cc66;">ChartObjects</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080;">'Loop through all series in the target chart</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each MySeries In oChart.<span style="color: #66cc66;">Chart</span>.<span style="color: #66cc66;">SeriesCollection</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Get Source Data Range for the target series</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; FormulaSplit = <span style="color: #b1b100;">Split</span><span style="color:#006600; font-weight:bold;">&#40;</span>MySeries.<span style="color: #66cc66;">Formula</span>, <span style="color: #ff0000;">","</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Capture the first cell in the source range then trap the color</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> SourceRange = Range<span style="color:#006600; font-weight:bold;">&#40;</span>FormulaSplit<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Item</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; SourceRangeColor = SourceRange.<span style="color: #66cc66;">Interior</span>.<span style="color: #66cc66;">Color</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Coloring for Excel 2003</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">Interior</span>.<span style="color: #66cc66;">Color</span> = SourceRangeColor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">Border</span>.<span style="color: #66cc66;">Color</span> = SourceRangeColor</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">MarkerBackgroundColorIndex</span> = SourceRangeColor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">MarkerForegroundColorIndex</span> = SourceRangeColor</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">'Coloring for Excel 2007 and 2010</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">MarkerBackgroundColor</span> = SourceRangeColor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #66cc66;">MarkerForegroundColor</span> = SourceRangeColor</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #b1b100;">Format</span>.<span style="color: #b1b100;">Line</span>.<span style="color: #66cc66;">ForeColor</span>.<span style="color: #b1b100;">RGB</span> = SourceRangeColor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #b1b100;">Format</span>.<span style="color: #b1b100;">Line</span>.<span style="color: #66cc66;">BackColor</span>.<span style="color: #b1b100;">RGB</span> = SourceRangeColor</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MySeries.<span style="color: #b1b100;">Format</span>.<span style="color: #66cc66;">Fill</span>.<span style="color: #66cc66;">ForeColor</span>.<span style="color: #b1b100;">RGB</span> = SourceRangeColor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Next</span> MySeries</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Next</span> oChart</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>…and Zoomo!  The chart will automatically adopt the colors in the source range.</p>
<p><img alt="" src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081011_0553_Automatical31.png" /></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>It works for column charts too.</p>
<p><img alt="" src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/08/081011_0553_Automatical41.png" /></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p><strong>Notes:</p>
<p></strong></p>
<p>1. To use the macro, simply copy the code in this post and paste it into a standard module.</p>
<p>2. As the macro is written, the chart can only adopt the color of the first cell in the series range.  So you technically only have to color the first cell in source data for each series.</p>
<p>3. Remember this macro colors the entire chart series, not individual data points - so you couldn't use this on a Pie Chart.</p>
<p>4. In my limited testing, I've confirmed that this macro works in Excel 2003, 2007, 2010.</p>
<p>5. And before you dashboarding nerds ping me, I know that gaudy colors like Yellow, Red, and Orange are bad - I used them for demonstration purposes only.</p>
<p><a href="http://www.datapigtechnologies.com/downloads/CellColorsToChart.xlsm"><span style="font-size: 12pt;"><strong>You can download a demo here</strong></span></a><span style="font-size: 12pt;"><strong></p>
<p></strong></span></p>
<p><span style="color: white;">.</p>
<p></span></p>
<p>Hopefully, this is useful to somebody out there.</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-format-pivottables-to-match-source-data/' rel='bookmark' title='Auto Format PivotTables to Match Source Data'>Auto Format PivotTables to Match Source Data</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/automatically-unprotect-sheets-based-on-domain-name/' rel='bookmark' title='Automatically Unprotect Sheets Based on Domain Name'>Automatically Unprotect Sheets Based on Domain Name</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/status-bar-fun-show-cell-selection-info/' rel='bookmark' title='Status Bar Fun – Show Cell Selection Info'>Status Bar Fun – Show Cell Selection Info</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/fun-with-custom-lists/' rel='bookmark' title='Fun with Custom Lists'>Fun with Custom Lists</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/automatically-set-chart-series-colors-to-match-source-cell-colors/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

