<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Microsoft Excel</title><subtitle type="html">The team blog for Microsoft Excel and Excel Services.</subtitle><id>http://blogs.msdn.com/excel/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/excel/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-02-02T11:19:00Z</updated><entry><title>Use the VBA SaveAs Method in Excel 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/07/07/use-the-vba-saveas-method-in-excel-2007.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/07/07/use-the-vba-saveas-method-in-excel-2007.aspx</id><published>2009-07-07T19:39:36Z</published><updated>2009-07-07T19:39:36Z</updated><content type="html">&lt;p&gt;&lt;em&gt;Today’s author is Ron de Bruin , an Excel MVP. You can find more useful tips and links to Excel add-ins at his website: &lt;a title="http://www.rondebruin.nl/tips.htm" href="http://www.rondebruin.nl/" target="_blank"&gt;http://www.rondebruin.nl/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You see a lot of old &lt;strong&gt;SaveAs&lt;/strong&gt; code that does not specify the &lt;em&gt;FileFormat&lt;/em&gt;     &lt;br /&gt;parameter. In Excel versions before Excel 2007, code without this parameter     &lt;br /&gt;will not cause too many problems because Excel will use the current &lt;strong&gt;FileFormat&lt;/strong&gt;     &lt;br /&gt;of the existing file -- and the default &lt;strong&gt;FileFormat&lt;/strong&gt; for new files is a normal workbook. But because there are so many new file formats in Excel 2007, you shouldn't     &lt;br /&gt;use code that doesn’t specify the &lt;em&gt;FileFormat&lt;/em&gt; parameter.&lt;/p&gt;  &lt;p&gt;In Excel 2007, the &lt;strong&gt;SaveAs&lt;/strong&gt; method requires you to provide both the &lt;em&gt;FileFormat&lt;/em&gt; parameter and the correct file extension.&lt;/p&gt;  &lt;p&gt;For example, in Excel 2007 this line of code will &lt;em&gt;fail&lt;/em&gt; if the &lt;strong&gt;ActiveWorkbook&lt;/strong&gt; is not an .xlsm file:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;ActiveWorkbook.SaveAs &lt;span class="str"&gt;&amp;quot;C:\ron.xlsm&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;But this code will always work:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;ActiveWorkbook.SaveAs &lt;span class="str"&gt;&amp;quot;C:\ron.xlsm&amp;quot;&lt;/span&gt;, fileformat:=52 
&lt;span class="rem"&gt;' 52 = xlOpenXMLWorkbookMacroEnabled = xlsm (workbook with macro's in 2007)&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;These are the main file formats in Excel 2007:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;51&lt;/b&gt; = xlOpenXMLWorkbook (without macro's in 2007, .xlsx) 

  &lt;br /&gt;&lt;b&gt;52&lt;/b&gt; = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007, .xlsm) 

  &lt;br /&gt;&lt;b&gt;50&lt;/b&gt; = xlExcel12 (Excel Binary Workbook in 2007 with or without macro's, .xlsb) 

  &lt;br /&gt;&lt;b&gt;56&lt;/b&gt; = xlExcel8 (97-2003 format in Excel 2007, .xls)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: I always use the &lt;em&gt;FileFormat&lt;/em&gt; numbers instead of the defined constants 

  &lt;br /&gt;in my code so that it will compile OK when I copy the code into an Excel 

  &lt;br /&gt;97-2003 workbook. (For example, Excel 97-2003 won't know what the 

  &lt;br /&gt;&lt;strong&gt;xlOpenXMLWorkbookMacroEnabled&lt;/strong&gt; constant is.)&lt;/p&gt;

&lt;h3&gt;Example&lt;/h3&gt;

&lt;p&gt;At the end of this section is a basic VBA code example for a macro named &lt;font face="Courier New"&gt;&lt;strong&gt;Copy_ActiveSheet_New_Workbook()&lt;/strong&gt;&lt;/font&gt; that copies the &lt;strong&gt;ActiveSheet&lt;/strong&gt; to a new &lt;strong&gt;Workbook&lt;/strong&gt; and then saves it in a format that matches the file extension of the parent workbook. 

  &lt;br /&gt;&lt;b&gt;Note&lt;/b&gt;: You can use this macro in Excel 97-2007.&lt;/p&gt;

&lt;p&gt;If you run the code in Excel 2007, it will look at the &lt;strong&gt;FileFormat&lt;/strong&gt; of the parent workbook and save the new file in that format. However, if the parent workbook is an .xlsm file &lt;em&gt;and&lt;/em&gt; there is no VBA code in the new workbook, the code will save the new file as an .xlsx file. 

  &lt;br /&gt;If the parent workbook is not an .xlsx, .xlsm or .xls file, then it will be saved as an .xlsb file.&lt;/p&gt;

&lt;p&gt;If you always want to save in a certain format you can replace this part of the macro:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Select&lt;/span&gt; &lt;span class="kwrd"&gt;Case&lt;/span&gt; Sourcewb.FileFormat
&lt;span class="kwrd"&gt;Case&lt;/span&gt; 51: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsx&amp;quot;&lt;/span&gt;: FileFormatNum = 51
&lt;span class="kwrd"&gt;Case&lt;/span&gt; 52:
    &lt;span class="kwrd"&gt;If&lt;/span&gt; .HasVBProject &lt;span class="kwrd"&gt;Then&lt;/span&gt;
        FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsm&amp;quot;&lt;/span&gt;: FileFormatNum = 52
    &lt;span class="kwrd"&gt;Else&lt;/span&gt;
        FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsx&amp;quot;&lt;/span&gt;: FileFormatNum = 51
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
&lt;span class="kwrd"&gt;Case&lt;/span&gt; 56: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xls&amp;quot;&lt;/span&gt;: FileFormatNum = 56
&lt;span class="kwrd"&gt;Case&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt;: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsb&amp;quot;&lt;/span&gt;: FileFormatNum = 50
&lt;span class="kwrd"&gt;End&lt;/span&gt; Select&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;With the single line of code from this list for the format you want to use:&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsb&amp;quot;&lt;/span&gt;: FileFormatNum = 50 
FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsx&amp;quot;&lt;/span&gt;: FileFormatNum = 51
FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsm&amp;quot;&lt;/span&gt;: FileFormatNum = 52
FileExtStr = &lt;span class="str"&gt;&amp;quot;.xls&amp;quot;&lt;/span&gt;: FileFormatNum = 56&lt;/pre&gt;

&lt;p&gt;Or maybe you want to save the one sheet workbook to .csv, .txt, or .prn. (you can use this also if you run the macro in Excel 97-2003)&lt;/p&gt;

&lt;pre class="csharpcode"&gt;FileExtStr = &lt;span class="str"&gt;&amp;quot;.csv&amp;quot;&lt;/span&gt;: FileFormatNum = 6
FileExtStr = &lt;span class="str"&gt;&amp;quot;.txt&amp;quot;&lt;/span&gt;: FileFormatNum = -4158
FileExtStr = &lt;span class="str"&gt;&amp;quot;.prn&amp;quot;&lt;/span&gt;: FileFormatNum = 36&lt;/pre&gt;

&lt;p&gt;Here’s the full code example.&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Sub&lt;/span&gt; Copy_ActiveSheet_New_Workbook()
&lt;span class="rem"&gt;'Working in Excel 97-2007&lt;/span&gt;
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; FileExtStr &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; FileFormatNum &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Long&lt;/span&gt;
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; Sourcewb &lt;span class="kwrd"&gt;As&lt;/span&gt; Workbook
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; Destwb &lt;span class="kwrd"&gt;As&lt;/span&gt; Workbook
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; TempFilePath &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; TempFileName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;

    &lt;span class="kwrd"&gt;With&lt;/span&gt; Application
        .ScreenUpdating = &lt;span class="kwrd"&gt;False&lt;/span&gt;
        .EnableEvents = &lt;span class="kwrd"&gt;False&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt;

    &lt;span class="kwrd"&gt;Set&lt;/span&gt; Sourcewb = ActiveWorkbook

    &lt;span class="rem"&gt;'Copy the sheet to a new workbook&lt;/span&gt;
    ActiveSheet.Copy
    &lt;span class="kwrd"&gt;Set&lt;/span&gt; Destwb = ActiveWorkbook

    &lt;span class="rem"&gt;'Determine the Excel version and file extension/format&lt;/span&gt;
    &lt;span class="kwrd"&gt;With&lt;/span&gt; Destwb
        &lt;span class="kwrd"&gt;If&lt;/span&gt; Val(Application.Version) &amp;lt; 12 &lt;span class="kwrd"&gt;Then&lt;/span&gt;
            &lt;span class="rem"&gt;'You use Excel 97-2003&lt;/span&gt;
            FileExtStr = &lt;span class="str"&gt;&amp;quot;.xls&amp;quot;&lt;/span&gt;: FileFormatNum = -4143
        &lt;span class="kwrd"&gt;Else&lt;/span&gt;
            &lt;span class="rem"&gt;'You use Excel 2007&lt;/span&gt;
            &lt;span class="rem"&gt;'We exit the sub when your answer is NO in the security dialog that you&lt;/span&gt;
            &lt;span class="rem"&gt;'only see when you copy a sheet from a xlsm file with macro's disabled.&lt;/span&gt;
            &lt;span class="kwrd"&gt;If&lt;/span&gt; Sourcewb.Name = .Name &lt;span class="kwrd"&gt;Then&lt;/span&gt;
                &lt;span class="kwrd"&gt;With&lt;/span&gt; Application
                    .ScreenUpdating = &lt;span class="kwrd"&gt;True&lt;/span&gt;
                    .EnableEvents = &lt;span class="kwrd"&gt;True&lt;/span&gt;
                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt;
                MsgBox &lt;span class="str"&gt;&amp;quot;Your answer is NO in the security dialog&amp;quot;&lt;/span&gt;
                &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;
            &lt;span class="kwrd"&gt;Else&lt;/span&gt;
                &lt;span class="kwrd"&gt;Select&lt;/span&gt; &lt;span class="kwrd"&gt;Case&lt;/span&gt; Sourcewb.FileFormat
                &lt;span class="kwrd"&gt;Case&lt;/span&gt; 51: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsx&amp;quot;&lt;/span&gt;: FileFormatNum = 51
                &lt;span class="kwrd"&gt;Case&lt;/span&gt; 52:
                    &lt;span class="kwrd"&gt;If&lt;/span&gt; .HasVBProject &lt;span class="kwrd"&gt;Then&lt;/span&gt;
                        FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsm&amp;quot;&lt;/span&gt;: FileFormatNum = 52
                    &lt;span class="kwrd"&gt;Else&lt;/span&gt;
                        FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsx&amp;quot;&lt;/span&gt;: FileFormatNum = 51
                    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
                &lt;span class="kwrd"&gt;Case&lt;/span&gt; 56: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xls&amp;quot;&lt;/span&gt;: FileFormatNum = 56
                &lt;span class="kwrd"&gt;Case&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt;: FileExtStr = &lt;span class="str"&gt;&amp;quot;.xlsb&amp;quot;&lt;/span&gt;: FileFormatNum = 50
                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Select&lt;/span&gt;
            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt;

    &lt;span class="rem"&gt;'    'If you want to change all cells in the worksheet to values, uncomment these lines.&lt;/span&gt;
    &lt;span class="rem"&gt;'    With Destwb.Sheets(1).UsedRange&lt;/span&gt;
    &lt;span class="rem"&gt;'        .Cells.Copy&lt;/span&gt;
    &lt;span class="rem"&gt;'        .Cells.PasteSpecial xlPasteValues&lt;/span&gt;
    &lt;span class="rem"&gt;'        .Cells(1).Select&lt;/span&gt;
    &lt;span class="rem"&gt;'    End With&lt;/span&gt;
    &lt;span class="rem"&gt;'    Application.CutCopyMode = False&lt;/span&gt;

    &lt;span class="rem"&gt;'Save the new workbook and close it&lt;/span&gt;
    TempFilePath = Application.DefaultFilePath &amp;amp; &lt;span class="str"&gt;&amp;quot;\&amp;quot;&lt;/span&gt;
    TempFileName = &lt;span class="str"&gt;&amp;quot;Part of &amp;quot;&lt;/span&gt; &amp;amp; Sourcewb.Name &amp;amp; &lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; Format(Now, &lt;span class="str"&gt;&amp;quot;yyyy-mm-dd hh-mm-ss&amp;quot;&lt;/span&gt;)

    &lt;span class="kwrd"&gt;With&lt;/span&gt; Destwb
        .SaveAs TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr, FileFormat:=FileFormatNum
        .Close SaveChanges:=&lt;span class="kwrd"&gt;False&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt;

    MsgBox &lt;span class="str"&gt;&amp;quot;You can find the new file in &amp;quot;&lt;/span&gt; &amp;amp; TempFilePath

    &lt;span class="kwrd"&gt;With&lt;/span&gt; Application
        .ScreenUpdating = &lt;span class="kwrd"&gt;True&lt;/span&gt;
        .EnableEvents = &lt;span class="kwrd"&gt;True&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823085" width="1" height="1"&gt;</content><author><name>MRoberts</name><uri>http://blogs.msdn.com/members/MRoberts.aspx</uri></author><category term="Programmability" scheme="http://blogs.msdn.com/excel/archive/tags/Programmability/default.aspx" /><category term="File Format" scheme="http://blogs.msdn.com/excel/archive/tags/File+Format/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>New Change to the Excel blog</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/06/30/new-change-to-the-excel-blog.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/06/30/new-change-to-the-excel-blog.aspx</id><published>2009-06-30T16:43:00Z</published><updated>2009-06-30T16:43:00Z</updated><content type="html">&lt;P&gt;I’d like to take this opportunity to announce a new feature of the blog, which some of you might have noticed already. Our Content Publishing team has begun collecting “Power Tips” from members of the Excel community, including the product team, Excel MVPs, user group members, and other Excel enthusiasts. Power Tips are intermediate-level “How-to” tips that you can use to enhance your spreadsheets. We hope they’ll be valuable to those of you who feel pretty proficient with Excel, but who don’t consider yourselves seasoned spreadsheet "developers" (yet).&lt;/P&gt;
&lt;P&gt;We have already tagged a number of past posts with the &lt;A href="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" mce_href="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx"&gt;Power Tips&lt;/A&gt; tag, so you can start following this feature today by clicking the tag on the right side of this page. You can even set up an &lt;A href="http://blogs.msdn.com/excel/rss.aspx?Tags=Power+Tips&amp;amp;AndTags=1" mce_href="http://blogs.msdn.com/excel/rss.aspx?Tags=Power+Tips&amp;amp;AndTags=1"&gt;RSS feed&lt;/A&gt;&amp;nbsp;for just that tag, if you want. &lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809801" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author></entry><entry><title>Week Numbers in Excel</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/06/30/week-numbers-in-excel.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/06/30/week-numbers-in-excel.aspx</id><published>2009-06-30T07:00:00Z</published><updated>2009-06-30T07:00:00Z</updated><content type="html">&lt;p&gt;&lt;em&gt;Today’s author is, Ron de Bruin, an &lt;a href="https://mvp.support.microsoft.com/profile=0E083A79-62C2-41C3-9A4B-09CE20225D7E" target="_blank"&gt;Excel MVP&lt;/a&gt;. You can find more useful tips from Ron and links to Excel add-ins at his website: &lt;a title="http://www.rondebruin.nl/tips.htm" href="http://www.rondebruin.nl/" target="_blank"&gt;http://www.rondebruin.nl/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;There are four primary week numbering systems in use worldwide. Each system has subtle differences that you should be aware of. Excel can work with any of these systems:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;1)&amp;#160; ISO Week number: The International Organization for Standardization (ISO) ISO8601:2000 Standard.&lt;/b&gt;     &lt;br /&gt;All weeks begin on a Monday. Week one starts on Monday of the first week of the calendar year with a Thursday.     &lt;br /&gt;&lt;b&gt;2)&amp;#160; Excel WEEKNUM function with an optional second argument of 1 (default).&lt;/b&gt;     &lt;br /&gt;Week one begins on January 1st; week two begins on the following Sunday.     &lt;br /&gt;&lt;b&gt;3)&amp;#160; Excel WEEKNUM function with an optional second argument of 2.&lt;/b&gt;     &lt;br /&gt;Week one begins on January 1st; week two begins on the following Monday.     &lt;br /&gt;&lt;b&gt;4)&amp;#160; Simple week numbering.&lt;/b&gt;     &lt;br /&gt;Week one begins on January 1st, week two begins on January 8th, and week 53 has only one or two days (for leap years).&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Excel does not have a standard worksheet function for the ISO week number and simple week numbering system.&lt;/p&gt;  &lt;h3&gt;Worksheet Formulas for Week Numbers&lt;/h3&gt;  &lt;p&gt;The following sections assume that you have a date in cell &lt;b&gt;B4&lt;/b&gt; for testing the week number formulas.&lt;/p&gt;  &lt;h3&gt;&lt;/h3&gt;  &lt;h5&gt;ISO Week Numbers&lt;/h5&gt;  &lt;p&gt;There is no built-in worksheet function for ISO week numbers in Excel. Copy the following formula and paste it in a worksheet cell to return an ISO week number:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;=INT((B4-DATE(YEAR(B4-WEEKDAY(B4-1)+4),1,3)+WEEKDAY(DATE(YEAR(B4-WEEKDAY(B4-1)+4),1,3))+5)/7)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Alternatively, you can open the Visual Basic editor, click &lt;strong&gt;Module&lt;/strong&gt; on the &lt;strong&gt;Insert&lt;/strong&gt; menu, and then copy this user-defined function (UDF) into the module. After adding this UDF to your workbook, you can use it like a built-in function &lt;strong&gt;=IsoWeekNumber(B4)&lt;/strong&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; IsoWeekNumber(d1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Date&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
&lt;span class="rem"&gt;' Attributed to Daniel Maher&lt;/span&gt;
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; d2 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Long&lt;/span&gt;
    d2 = DateSerial(Year(d1 - WeekDay(d1 - 1) + 4), 1, 3)
    IsoWeekNumber = Int((d1 - d2 + WeekDay(d2) + 5) / 7)
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;/pre&gt;

&lt;p&gt;You can find more information about ISO dates and week numbers on this page: &lt;a href="http://www.rondebruin.nl/isodate.htm"&gt;http://www.rondebruin.nl/isodate.htm&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;The Excel WEEKNUM Function &lt;/h5&gt;

&lt;p&gt;Reliance on the Analysis Toolpak in Excel versions before Excel 2007 can create problems because the add-in may not 
  &lt;br /&gt;be installed by users of your spreadsheets (a default Excel installation has it unchecked in setup). Also, there are difficulties for international users when you use Analysis Toolpak formulas because these formulas are not translated by Excel if you open the workbook in a different Excel language version.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: In Excel 2007 &lt;strong&gt;WEEKNUM&lt;/strong&gt; is a standard built-in worksheet function, so you will not have the problems above if you share your workbook between different Excel 2007 language versions.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Important&lt;/b&gt;: If you do not have Office 2007 SP2 installed, read the information on this page: &lt;a href="http://www.rondebruin.nl/atp.htm"&gt;http://www.rondebruin.nl/atp.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use these two replacement functions from Daniel Maher to avoid problems.&lt;/p&gt;

&lt;p&gt;Replace &lt;strong&gt;=WEEKNUM(B4,1)&lt;/strong&gt; with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;=1+INT((B4-(DATE(YEAR(B4),1,2)-WEEKDAY(DATE(YEAR(B4),1,1))))/7)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;strong&gt;=WEEKNUM(B4,2)&lt;/strong&gt; with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;=1+INT((B4-(DATE(YEAR(B4),1,2)-WEEKDAY(DATE(YEAR(B4),1,0))))/7)&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;Simple Week Numbers&lt;/h5&gt;

&lt;p&gt;There is no built-in worksheet function for simple week numbering in Excel. Copy the following function and paste it in a worksheet cell to return simple week numbers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;=INT((B4-DATE(YEAR(B4),1,1))/7)+1&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;The Week Calendar File&lt;/h3&gt;

&lt;p&gt;The week calendar file shows you all the dates and week numbers from a certain year on one printable page. If you want to have a week calendar from another year you only have to change one cell (the year). There is a separate sheet for each of the four week numbering systems listed at the start of this post.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Download the Calendar file&lt;/b&gt; 

  &lt;br /&gt;&lt;a href="http://www.rondebruin.nl/files/Week%20Numbers%20Calendar.zip"&gt;Week Numbers Calendar.zip&lt;/a&gt; (File date : 27-Feb-2005)&lt;/p&gt;

&lt;h3&gt;Acknowledgements&lt;/h3&gt;

&lt;p&gt;I would like to acknowledge general reference on all date issues to: 
  &lt;br /&gt;&lt;b&gt;Chip Pearson&lt;/b&gt;: &lt;a href="http://www.cpearson.com/excel/topic.aspx"&gt;http://www.cpearson.com/excel/topic.aspx&lt;/a&gt; 

  &lt;br /&gt;&lt;b&gt;Dave McRitchie&lt;/b&gt;: &lt;a href="http://www.mvps.org/dmcritchie/excel/xlindex.htm"&gt;http://www.mvps.org/dmcritchie/excel/xlindex.htm&lt;/a&gt; 

  &lt;br /&gt;&lt;b&gt;Daniel Maher&lt;/b&gt; has also published numerous simplifications of date formulas some of which were used or adapted in producing the calendar. 

  &lt;br /&gt;&lt;b&gt;The late Frank Kabel&lt;/b&gt; Frank created the ISO week number worksheet function on this page. 

  &lt;br /&gt;The base formula used for the ISO year start in the calendar file were derived from a UDF written by &lt;b&gt;John Green&lt;/b&gt;, Sydney.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;More Information&lt;/u&gt;&lt;/b&gt; 

  &lt;br /&gt;ISO Date Representatation and Week Numbering: 

  &lt;br /&gt;&lt;a href="http://www.rondebruin.nl/isodate.htm"&gt;http://www.rondebruin.nl/isodate.htm&lt;/a&gt; 

  &lt;br /&gt;You should refer to Chip Pearson's web site for an exposition on Week Number implementation: 

  &lt;br /&gt;&lt;a href="http://www.cpearson.com/excel/weeknum.htm"&gt;http://www.cpearson.com/excel/weeknum.htm&lt;/a&gt; 

  &lt;br /&gt;Implementing Week-Numbering Systems and Date/Time Representations: 

  &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb277364.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb277364.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809149" width="1" height="1"&gt;</content><author><name>MRoberts</name><uri>http://blogs.msdn.com/members/MRoberts.aspx</uri></author><category term="Formulas and functions" scheme="http://blogs.msdn.com/excel/archive/tags/Formulas+and+functions/default.aspx" /><category term="UDFs" scheme="http://blogs.msdn.com/excel/archive/tags/UDFs/default.aspx" /><category term="Programmability" scheme="http://blogs.msdn.com/excel/archive/tags/Programmability/default.aspx" /><category term="File Format" scheme="http://blogs.msdn.com/excel/archive/tags/File+Format/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>Formula to Access a List of Values Interspersed with Zeros or Blanks</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/06/30/formula-to-access-a-list-of-values-interspersed-with-zeros-or-blanks.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/06/30/formula-to-access-a-list-of-values-interspersed-with-zeros-or-blanks.aspx</id><published>2009-06-30T07:00:00Z</published><updated>2009-06-30T07:00:00Z</updated><content type="html">&lt;p&gt;&lt;em&gt;Today’s author is Bob Umlas, an &lt;a href="https://mvp.support.microsoft.com/default.aspx/profile=702d490b-b575-4e2c-93c5-00e5bc1110fb" target="_blank"&gt;Excel MVP&lt;/a&gt; since 1994.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This tip is a formula which enables you to access a list of values interspersed with zeros or blanks and pick up only the non-zero values in the same sequence they’re listed. It’s better to illustrate. Suppose you have this list in A1:A14:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image01_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image01" border="0" alt="image01" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image01_thumb.jpg" width="161" height="315" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;…and you want to produce this list:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image02_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image02" border="0" alt="image02" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image02_thumb.jpg" width="75" height="151" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The following formula entered in E1 and filled down to E6 does the trick. It’s an array formula which means that you must press Ctrl+Shift+Enter after entering the formula instead of just Enter:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;=INDEX($A$1:$A$14,SMALL(IF($A$1:$A$14&amp;lt;&amp;gt;0,ROW($1:$14),&amp;quot;&amp;quot;),ROW(A1)))&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Let’s take the formula apart and see how it works. The inner IF-statement, &lt;strong&gt;IF($A$1:$A$14&amp;lt;&amp;gt;0,ROW($1:$14),&amp;quot;&amp;quot;)&lt;/strong&gt;, checks for non-zeros, and if it &lt;i&gt;is&lt;/i&gt; a non-zero, it returns the row number; otherwise it returns blanks. If you select that portion of the formula in E1 and press the F9 key, you’ll see this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image03_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image03" border="0" alt="image03" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image03_thumb.jpg" width="595" height="29" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;…which means that rows 1,4,7,9,10 and 14 do not contain zeros or blanks. &lt;strong&gt;ROW(A1)&lt;/strong&gt; returns the value 1 and is used instead of simply the number 1 because this formula is being filled down, and in the row below it will become &lt;strong&gt;ROW(A2),&lt;/strong&gt; returning a 2, etc. So, the &lt;strong&gt;SMALL&lt;/strong&gt; function now returns the smallest value from that list, or 1. In the row below, we have &lt;strong&gt;ROW(A2)&lt;/strong&gt; or 2, and the 2&lt;sup&gt;nd&lt;/sup&gt; smallest value is 4. So each formula returns the &lt;i&gt;row&lt;/i&gt; number for the non-zero cells. That in turn is passed to the &lt;strong&gt;INDEX&lt;/strong&gt; function, and we effectively have these formulas:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;=INDEX(A1:A14,1)      &lt;br /&gt;=INDEX(A1:A14,4)       &lt;br /&gt;=INDEX(A1:A14,7)       &lt;br /&gt;&lt;/strong&gt;and so on, which returns the values we need for the list of non-zero values.&lt;/p&gt;  &lt;p&gt;As an additional tip, because it may not be clear how far down to fill, you can use conditional formatting to hide the potential errors if you were to drag down too far. That is, suppose you initially dragged the formula down to E8:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image04_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image04" border="0" alt="image04" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image04_thumb.jpg" width="495" height="227" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can hide these this way. Select all of column E, then click &lt;strong&gt;Home&lt;/strong&gt; &amp;gt; &lt;strong&gt;Conditional Formatting&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Rule&lt;/strong&gt; &amp;gt; &lt;strong&gt;Use a formula to determine which cells to format&lt;/strong&gt;, and enter this formula:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;=ISERROR(E1)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image05_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image05" border="0" alt="image05" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image05_thumb.jpg" width="389" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then click the &lt;strong&gt;Format&lt;/strong&gt; button, the &lt;strong&gt;Font&lt;/strong&gt; tab, and select a white font:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image06_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image06" border="0" alt="image06" src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/FormulatoAccessaListofValuesInterspersed_BD1D/image06_thumb.jpg" width="471" height="507" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then, when you click &lt;strong&gt;OK&lt;/strong&gt; all the way out, the #NUM! errors won’t show.&lt;/p&gt;  &lt;p&gt;The reason this formula must be entered as an array-formula is because the &lt;strong&gt;IF(A1:A14&amp;lt;&amp;gt;0&lt;/strong&gt;… portion of the formula requires it. The &lt;strong&gt;IF-statement&lt;/strong&gt; normally takes one value to test for true/false, not an &lt;i&gt;array&lt;/i&gt; of values as we did here. If you don’t use Ctrl+Shift+Enter to create an array formula, you will get #VALUE! and #NUM! errors.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809151" width="1" height="1"&gt;</content><author><name>MRoberts</name><uri>http://blogs.msdn.com/members/MRoberts.aspx</uri></author><category term="Formulas and functions" scheme="http://blogs.msdn.com/excel/archive/tags/Formulas+and+functions/default.aspx" /><category term="Data Cleansing/Manipulation" scheme="http://blogs.msdn.com/excel/archive/tags/Data+Cleansing_2F00_Manipulation/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>Microsoft Office 2010 Technical Preview</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/05/12/microsoft-office-2010-technical-preview.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/05/12/microsoft-office-2010-technical-preview.aspx</id><published>2009-05-12T18:38:00Z</published><updated>2009-05-12T18:38:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: black; mso-ansi-language: EN" lang=EN&gt;Today, Microsoft is announcing&amp;nbsp;a limited, invitation only &lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;Technical Preview &lt;/SPAN&gt;&lt;SPAN style="COLOR: black; mso-ansi-language: EN" lang=EN&gt;program&amp;nbsp;for &lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;Microsoft Office 2010 &lt;/SPAN&gt;&lt;SPAN style="COLOR: black; mso-ansi-language: EN" lang=EN&gt;that will kick off in July. The &lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;program will provide you with the opportunity to experience early, pre-release versions of Office 2010 which will include the following applications:&amp;nbsp; Word 2010, Excel 2010, Outlook 2010, PowerPoint 2010, OneNote 2010, Access 2010, InfoPath 2010 and Publisher 2010. &lt;/SPAN&gt;&lt;SPAN style="COLOR: black; mso-ansi-language: EN" lang=EN&gt;Check out &lt;A href="http://www.office2010themovie.com/" mce_href="http://www.office2010themovie.com/"&gt;&lt;SPAN style="COLOR: black"&gt;www.office2010themovie.com&lt;/SPAN&gt;&lt;/A&gt; for signing up to be considered for the Technical Preview Program. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: black"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9607912" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author></entry><entry><title>VBA Coding Contest</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/04/17/vba-coding-contest.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/04/17/vba-coding-contest.aspx</id><published>2009-04-17T07:55:00Z</published><updated>2009-04-17T07:55:00Z</updated><content type="html">&lt;P&gt;I'm passing along some information I think will be interesting to many of the readers of this blog.&amp;nbsp;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;&lt;FONT size=3&gt;Test your VBA coding skills and win!&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;MSDN® is sponsoring a coding contest for Office 2007, named &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/officepalooza"&gt;&lt;FONT size=3 face=Calibri&gt;OfficePalooza&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;! This sweepstakes will run two weeks beginning April 20, 2009, and features ten fun Visual Basic of Applications™ (VBA) coding challenges in the form of puzzles and games. Each entrant will earn a chance to win one of hundreds of available prizes, determined by a random drawing at the end of the contest.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In conjunction with this contest, an Advanced Business User theme will run on &lt;/FONT&gt;&lt;A href="http://office.microsoft.com/"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Microsoft Office Online&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; from mid-April to mid-May, and will showcase the automation and extensibility aspects of Office 2007 through macros, custom VBA coding, the Fluent UI, and Office Open XML.&amp;nbsp; This collaborative effort will also highlight existing and newly-created content on the &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/office"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;MSDN Microsoft Office Developer Center&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553971" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Programmability" scheme="http://blogs.msdn.com/excel/archive/tags/Programmability/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>Modifying Conditional Formatting Color Ranges in Excel 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/04/16/modifying-conditional-formatting-color-ranges-in-excel-2007.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="21118" href="http://blogs.msdn.com/excel/attachment/9553634.ashx" /><id>http://blogs.msdn.com/excel/archive/2009/04/16/modifying-conditional-formatting-color-ranges-in-excel-2007.aspx</id><published>2009-04-17T00:08:00Z</published><updated>2009-04-17T00:08:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s authors, Amit Velingkar, a Program Manager on the Excel team, and Bob Silverstein, a User Experience Researcher on the Excel team, talk about creating professional looking Color Ranges in Excel.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Introduction:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;My fellow PM on Excel, Robin Wakefield, wrote a &lt;A href="http://blogs.msdn.com/excel/archive/2009/02/24/how-to-create-a-professional-chart-using-excel-2007.aspx" mce_href="http://blogs.msdn.com/excel/archive/2009/02/24/how-to-create-a-professional-chart-using-excel-2007.aspx"&gt;blog&lt;/A&gt; article on how to create professional looking charts in Excel 2007. Continuing with the same theme, we will investigate the idea of tweaking Color Ranges in Excel 2007. We will start with a default Conditional Formatting Color Range and modify it to give it more pastel look. Also, this would be an ideal forum to give us your feedback on existing conditional formatting colors used in Excel 2007.&lt;/P&gt;
&lt;P&gt;As a part of my preparation for this article, I did two things – researched customer files that use conditional formatting and explored various options with Microsoft designers.&lt;/P&gt;
&lt;P&gt;Looking at some customer files, I quickly observed a trend. I found out that many users wanted to highlight a small portion of their data. They were achieving this by changing some of the colors in their color ranges to white. Also, some customers preferred a pastel shade of the same color. &lt;/P&gt;
&lt;P&gt;I discussed this trend with Microsoft designers and they taught me some neat tricks about manipulating colors. First, they told me that choosing the correct shade of white was critical while mixing colors. And last, an intuitive way of changing shades of colors was to use the HSL (Hue, Saturation and Luminosity) model.&lt;/P&gt;
&lt;P&gt;My blog article attempts to bring all these lessons together. We will change some of the colors to white and tweak the colors shades to pastel. Finally, we will introduce a VBA macro that lets you quickly try out new color shades.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Procedure:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;1. I started out with applying three of our default color combinations to some data. I choose the following color ranges: Red-Yellow-Green, Red-Yellow-Blue and Yellow-Green.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002 border=0 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002_thumb.jpg" width=197 height=346 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. I replaced the yellow color with the appropriate shades of “white”.&lt;/P&gt;
&lt;P&gt;Changing the yellow colors to pure whites created a high contrast. For creating whites with a good spectrum of colors, we crank up the RGB values all the way to 255 creating a pure white – Remember RGB (255,255,255) is white. Then, remove just a little amount of the participating color to create “target” white.&lt;/P&gt;
&lt;P&gt;As an example while mixing Red and Green, we set our white to (&lt;B&gt;250,250&lt;/B&gt;,255) by removing some red and green. The end result is a color range containing pure shades of Red and Green.&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=0 width=601&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;&lt;B&gt;Color 1&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;&lt;B&gt;Color 2&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=148&gt;
&lt;P&gt;&lt;B&gt;White&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=193&gt;
&lt;P&gt;&lt;B&gt;Notes&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Red (255,0,0)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Green (0,255,0)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=148&gt;
&lt;P&gt;(250,250,255) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=193&gt;
&lt;P&gt;Remove some red and green&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Red (255,0,0)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Blue (0,0,255)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=148&gt;
&lt;P&gt;(250,255,250) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=193&gt;
&lt;P&gt;Remove some red and blue&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Red(255,0,0)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=148&gt;
&lt;P&gt;(250,255,255) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=193&gt;
&lt;P&gt;Remove some red&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=129&gt;
&lt;P&gt;Green (0,255,0)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=139&gt;
&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=166&gt;
&lt;P&gt;(255,250,255)&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=266&gt;
&lt;P&gt;Remove some green&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600 bgColor=#e5b8b7&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=598&gt;Select the color range. On the &lt;B&gt;Home&lt;/B&gt; tab, click on &lt;B&gt;Conditional Formatting&lt;/B&gt;, then &lt;B&gt;Manage Rules&lt;/B&gt;. In the Conditional Formatting Rules Manager, select the Conditional Format and click on &lt;B&gt;Edit Rule&lt;/B&gt;. In the Edit Formatting Rule dialog change the yellow color to white.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B5%5D.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B5%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002[5] border=0 alt=clip_image002[5] src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B5%5D_thumb.jpg" width=191 height=346 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B5%5D_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;3. Using HSL Model to change non-white colors &lt;/P&gt;
&lt;P&gt;We can use the HSL model to manipulate color. HSL defines the color spectrum based on Hue (base color from the rainbow spectrum), Luminosity (brightness) and Saturation (purity of the color). &lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600 bgColor=#e5b8b7&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=598&gt;
&lt;P&gt;Select the color range. On the &lt;B&gt;Home&lt;/B&gt; tab, click on &lt;B&gt;Conditional Formatting&lt;/B&gt;, then &lt;B&gt;Manage Rules&lt;/B&gt;. In the Conditional Formatting Rules Manager, select the Conditional Format and click on &lt;B&gt;Edit Rule&lt;/B&gt;. In the Edit Formatting Rule dialog, click on the &lt;B&gt;color&lt;/B&gt; dropdown and choose &lt;B&gt;More Colors&lt;/B&gt;. Click on the &lt;B&gt;Custom&lt;/B&gt; tab and choose &lt;B&gt;HSL&lt;/B&gt; in the &lt;B&gt;Color model&lt;/B&gt; dropdown.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;In this example, we will change colors using the HSL models as follows:&lt;/P&gt;
&lt;P&gt;o &lt;B&gt;Hue&lt;/B&gt;: Unchanged, this leaves the base color unchanged. Hence our Reds stay Red.&lt;/P&gt;
&lt;P&gt;o &lt;B&gt;Saturation&lt;/B&gt;: Decrease the Saturation to 150. This makes the colors more pastel.&lt;/P&gt;
&lt;P&gt;o &lt;B&gt;Luminosity&lt;/B&gt;: Increase the luminosity to 200. The goal is to increase the brightness to make the color more visible and showcase the text behind the color ranges. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B7%5D.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B7%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002[7] border=0 alt=clip_image002[7] src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B7%5D_thumb.jpg" width=190 height=346 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/clip_image002%5B7%5D_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Result:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;By using shades of white and by tweaking the luminosity and saturation of colors, we changed the color ranges as follows:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/image_thumb.png" width=475 height=351 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ModifyingConditionalFormattingColorRange_EAC9/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;HSL Color Manipulation using VBA:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Since I wanted to try out a lot of combinations of Luminosity and Saturation values to tweak color ranges, I decided to write a VBA macro to do this. I quickly learnt that while Excel allows HSL manipulation through the UI, it does not support HSL manipulation through VBA. I looked around for ways to manipulate HSL and finally found a &lt;A href="http://proofficedev.com/blog/category/vba/page/3/" mce_href="http://proofficedev.com/blog/category/vba/page/3/"&gt;blog post&lt;/A&gt; by Tony Jollans that did something similar. Although most of the code used is directly from Tony Jollans’s blog post, I wrote some additional subroutines, added some comments and re-factored some of the subroutines for my purpose.&lt;/P&gt;
&lt;P&gt;The entry function for my macro is called ChangeColorRangeColors().&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600 bgColor=#d9d9d9&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=598&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;Sub ChangeColorRangeColors() &lt;BR&gt;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp; For Each clrScale In Selection.FormatConditions &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each criteria In clrScale.ColorScaleCriteria &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' get clr &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clr = criteria.FormatColor.Color&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' split RGB &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SplitRGB clr, R, G, B&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'skip whites - when all RGB componenst are above 240 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If R &amp;lt; 240 Or G &amp;lt; 240 Or B &amp;lt; 240 Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' get HSL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RGBtoHSL clr, H, S, L&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' increase luminosity &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L = (iLuminosity / 255) ' from 0.0 to 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' decrease saturation &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; S = (iSaturation / 255) ' from 0.0 to 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' get RGB &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HSLtoRGB H, S, L, clr&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' set new clr &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; criteria.FormatColor.Color = clr&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next &lt;BR&gt;&amp;nbsp;&amp;nbsp; Next &lt;BR&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;At a high level, my HSL manipulator code works in the following ways:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Get the RGB encoded value from the selected color ranges. &lt;/LI&gt;
&lt;LI&gt;Split the RGB encoded values into the Red, Green and Blue components. &lt;/LI&gt;
&lt;LI&gt;Skip the white colors – we do not want to change these. &lt;/LI&gt;
&lt;LI&gt;Covert RGB into HSL. &lt;/LI&gt;
&lt;LI&gt;Modify the Saturation and Luminosity, leaving Hue unchanged. &lt;/LI&gt;
&lt;LI&gt;Convert the modified HSL values back to encoded RGB. &lt;/LI&gt;
&lt;LI&gt;Apply the new RGB value back to the color range. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;I won’t go into the details of converting between RGB and HSL values. These conversion routines are well documented and can be freely found on the internet. &lt;/P&gt;
&lt;P&gt;However, another tricky part was trying to split the encoded color value that is used by Excel into individual RGB components. VBA provides a function, aptly named RGB(), that returns an encoded long value when provided with the R,G and B components. I have used this function in my macro to set the Color Range colors. However, VBA does not provide a reverse function to split this encoded long value. I have used a custom function called &lt;B&gt;SplitRGB&lt;/B&gt; to do this.&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600 bgColor=#d9d9d9&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=600&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;Sub SplitRGB(RGB As Long, R As Double, G As Double, B As Double) &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;Dim HexString As String&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp; ' convert the long to Hex - bb:gg:rr &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;HexString = Hex(RGB)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp; ' in order to get r,g,b components out of the string, &lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp; ' we have to make it is atleast 6 characters long - bb:gg:rr &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;HexString = Right(String$(5, "0") &amp;amp; HexString, 6)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp; ' get each individual color and convert to an double (range: 0 to 255) &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;R = CDbl("&amp;amp;H" &amp;amp; Mid$(HexString, 5, 2)) &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;G = CDbl("&amp;amp;H" &amp;amp; Mid$(HexString, 3, 2)) &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;B = CDbl("&amp;amp;H" &amp;amp; Mid$(HexString, 1, 2)) &lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Lucida Console"&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;Since the R, G, B values span from 0 to 255 and can be accommodated in 1 byte. Excel uses a 4-Byte long to encode the RGB values. The first byte is used to store the red value, the second byte stores the green value and the third byte stores the blue values. An easy way to observe these values is to convert this encoded long into a hexadecimal string. We then split this string using the &lt;B&gt;Mid&lt;/B&gt; function to isolate the R, G, B components. Finally, we use a conveniently provided &lt;B&gt;CDbl&lt;/B&gt; function to convert hexadecimal text to a number. Observe that appending the “&amp;amp;H” enables the&lt;B&gt; CDbl &lt;/B&gt;function to identify the text as hexadecimal.&lt;/P&gt;
&lt;P&gt;To recap, We can create professional looking Conditional Formatting color ranges by choosing the correct shades of whites and using the HSL model to tweak Saturation and Luminosity values. I am hoping that by using these techniques and subroutines, you will be able to automate the look and feel of your Excel Spreadsheets.&lt;/P&gt;
&lt;P&gt;The attached workbook contains these color ranges and the VBA macros. We would love to hear your feedback on these colors.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553634" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Conditional Formatting" scheme="http://blogs.msdn.com/excel/archive/tags/Conditional+Formatting/default.aspx" /><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>A Robust Way To Reference Multiple Columns In a Table</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx</id><published>2009-04-09T06:45:00Z</published><updated>2009-04-09T06:45:00Z</updated><content type="html">&lt;P&gt;I’m sure many of you have built a spreadsheet like this before: you’ve got a table of data; one of the columns in this table contains a formula which references a span of columns in the same table.&amp;nbsp; The number of columns you need to reference may change over time as requirements change.&amp;nbsp; How do you you build this table in such a way that the number of columns can be changed without breaking the formula that references them?&lt;/P&gt;
&lt;P&gt;Let’s walk through a somewhat contrived but simple example to demonstrate the issue.&amp;nbsp; Say I’m a real estate investor and I’m tracking a list of houses I’m interested in purchasing.&amp;nbsp; I’m a demanding and detail oriented buyer so I want to know the square footage of the individual rooms in the dwelling.&amp;nbsp; Based on this information, I want to calculate the count of rooms in the dwelling as well as the total square feet of the rooms combined.&amp;nbsp; The table might look something like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_2.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=85 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb.png" width=522 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The formula for the “#Rooms” column looks something like this:&lt;/P&gt;
&lt;P&gt;=COUNT( Table1[[#This Row],[SqFt-Room1]:[SqFt-Room3]] )&lt;/P&gt;
&lt;P&gt;Now, let’s say I want to add a new house, but this new house has four rooms.&amp;nbsp; Simple, just add a column, right?&amp;nbsp; Not so fast; depending on &lt;EM&gt;how&lt;/EM&gt; we add that column our formulas for “#Rooms” and “Ttl Sq. ft.” may not update as expected.&lt;/P&gt;
&lt;P&gt;Or let’s say I’ve changed focus to small condominiums and no longer have a need for the “Room3” column.&amp;nbsp; If I attempt to delete it, then my formulas will break.&amp;nbsp; How do we avoid this?&lt;/P&gt;
&lt;P&gt;Here's one trick I use in such situations.&amp;nbsp; It may not be the best answer, but I’ll share it with you here and if others have suggestions to offer you can add them to the comments.&lt;/P&gt;
&lt;P&gt;Solution: add an extra “dummy” column before and after the span as end caps, and refer to those columns in your formulas.&amp;nbsp; Using our real estate example, I would add a column before “SqFt-Room1” called “RoomsStart” and one after “SqFt-Room3” called “RoomsEnd”, like so:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_6.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=85 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_2.png" width=534 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I would keep these columns empty and never put data in them.&amp;nbsp; This is important because otherwise my COUNT and SUM formulas may return the wrong results.&amp;nbsp; Then I’d highlight the columns a different shade (this is totally optional but I personally like the visual effect of marking off the start and end of the span) and resize them to something very small so they are out of the way for the most part, like so:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_8.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=85 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_3.png" width=569 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Alternatively, you can hide the columns if you so desire.&amp;nbsp; Then I’d update my formulas so that they referenced these columns instead, like so:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_10.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=85 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_4.png" width=569 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/ARobustWayToReferenceMultipleColumnsInaT_1450D/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, when I want to add a fourth room, I select the “RoomsEnd” column and right-click \ Insert and I get a new column which I can name “SqFt-Room4”.&amp;nbsp; This new column will automatically be included in my COUNT and SUM calculations.&amp;nbsp; Similarly, if I ever get rid of “SqFt-Room4”, I don’t have to worry about breaking any of my formulas.&amp;nbsp; It may not be the most elegant solution, but it gives me a virtually worry-free way to reference a changing number of columns in my table.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9539643" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Tables" scheme="http://blogs.msdn.com/excel/archive/tags/Tables/default.aspx" /><category term="Formulas and functions" scheme="http://blogs.msdn.com/excel/archive/tags/Formulas+and+functions/default.aspx" /><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /></entry><entry><title>Analyzing Data: Functions or PivotTables</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/03/23/analyzing-data-functions-of-pivottables.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="30531" href="http://blogs.msdn.com/excel/attachment/9502322.ashx" /><id>http://blogs.msdn.com/excel/archive/2009/03/23/analyzing-data-functions-of-pivottables.aspx</id><published>2009-03-23T19:27:00Z</published><updated>2009-03-23T19:27:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s author, Monica Poinescu, a Software Developer in Test on the Excel team, discusses two different approaches to analyzing data in Excel.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt; I've attached a file at the bottom of this blog that contains spreadsheets of the examples discussed in this post.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;My earlier &lt;A href="http://blogs.msdn.com/excel/archive/2009/02/09/simple-expense-tracking-with-new-excel-2007-functions.aspx" mce_href="http://blogs.msdn.com/excel/archive/2009/02/09/simple-expense-tracking-with-new-excel-2007-functions.aspx"&gt;blog&lt;/A&gt; on the new Excel 2007 function SUMIFS spawned a very interesting discussion (thanks to everyone who posted comments there): when trying to analyze/aggregate data in a table, how do we decide whether to use functions versus PivotTables?&lt;/P&gt;
&lt;P&gt;This blog outlines reasons to use one option or another. To better illustrate the two alternatives I’ll consider a real estate inspired example: let’s say I have list of homes for sale and their corresponding characteristics:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image002_2.jpg"&gt;&lt;IMG title=clip_image002 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=166 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image002_thumb.jpg" width=572 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and I’m trying to find the average price for those homes which have at least 3 bedrooms, a garage and are between 5 and 10 years old. Just by looking at the table, we see that only house3 and house4 satisfy all conditions and the average of their prices is 312,500.&lt;/P&gt;
&lt;P&gt;Here is a functions based solution:&lt;/P&gt;
&lt;P&gt;=AVERAGEIFS(G2:G6,C2:C6,"&amp;gt;2",E2:E6,"yes",F2:F6,"&amp;gt;1999",F2:F6,"&amp;lt;2004")&lt;/P&gt;
&lt;P&gt;which returns $ 312,500.&lt;/P&gt;
&lt;P&gt;To build a corresponding PivotTable, one can use several filters:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image004_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image004_2.jpg"&gt;&lt;IMG title=clip_image004 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=226 alt=clip_image004 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image004_thumb.jpg" width=374 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image004_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Advantages of PivotTables:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;While AVERAGEIFS is limited to using at most 127 conditions, PivotTables can handle more than 127 conditions.&lt;/LI&gt;
&lt;LI&gt;The elements of the set that fulfill all conditions are listed in the resulting PivotTable.&lt;/LI&gt;
&lt;LI&gt;PivotTables have a lot of flexibility: the ease of use offered by the &lt;A href="http://office.microsoft.com/en-us/excel/HP101773841033.aspx?pid=CH101768451033" mce_href="http://office.microsoft.com/en-us/excel/HP101773841033.aspx?pid=CH101768451033"&gt;new UI&lt;/A&gt; allows for a very quick detailed analysis of different available options. Nested layers in a PivotTable offer added results visualization.&lt;/LI&gt;
&lt;LI&gt;Several different approaches are possible: one can construct different PivotTables that answer the same question above.&lt;/LI&gt;
&lt;LI&gt;Particularly useful for large data sources: when relying on an external data source, you don’t need to bring all the data in Excel and one could, for example, use OLAP databases.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Advantages of using functions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;It’s easier to see in one glance all the conditions being used either by looking in the formula bar, or by listing all criteria in separate ranges.&lt;/LI&gt;
&lt;LI&gt;The result updates immediately when adding rows to the source table, while PivotTables need to be refreshed.&lt;/LI&gt;
&lt;LI&gt;The criteria, when referenced in a cell, could be as well the result of another formula, while value filters in PivotTables can only use constants. &lt;BR&gt;For example, in the formula above, one could replace &lt;BR&gt;=AVERAGEIFS(G2:G6,C2:C6,"&amp;gt;2",… &lt;BR&gt;with &lt;BR&gt;=AVERAGEIFS(G2:G6,C2:C6,I4,… &lt;BR&gt;where I4 contains another calculation ( e.g. ="&amp;gt;"&amp;amp;FIXED(SUM(1,1),0)). &lt;BR&gt;The image below shows a corresponding PivotTable filter: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image006_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image006_2.jpg"&gt;&lt;IMG title=clip_image006 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=126 alt=clip_image006 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image006_thumb.jpg" width=574 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/AnalyzingDataFunctionsofPivotTables_AD42/clip_image006_thumb.jpg"&gt;&lt;/A&gt; &lt;BR&gt;The last field will not accept formulas, only numbers.&lt;/LI&gt;
&lt;LI&gt;Formulas take little space and are easy to move around in a sheet.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Note that in both cases you can use the wildcard characters to define criteria. Also both solutions deal in a similar manner with missing data or errors in the range.&lt;/P&gt;
&lt;P&gt;I don't know if I can be fully objective on this question because I'm more of a formula person myself. If I've missed a reason you should pick one approach over another, feel free to let me know the reason you use formulas or PivotTables for summarizing data by leaving a comment.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9502322" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Formulas and functions" scheme="http://blogs.msdn.com/excel/archive/tags/Formulas+and+functions/default.aspx" /><category term="PivotTables" scheme="http://blogs.msdn.com/excel/archive/tags/PivotTables/default.aspx" /></entry><entry><title>Excel VBA Performance Coding Best Practices</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx</id><published>2009-03-12T23:27:00Z</published><updated>2009-03-12T23:27:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s author, Chad Rothschiller, a Program Manager on the Excel team, is back with a follow up from his &lt;/EM&gt;&lt;A href="http://blogs.msdn.com/excel/archive/2009/01/06/vba-excel-performance-your-feedback-requested.aspx" mce_href="http://blogs.msdn.com/excel/archive/2009/01/06/vba-excel-performance-your-feedback-requested.aspx"&gt;&lt;EM&gt;previous post on VBA and Excel performance&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I want to start off this post by thanking everyone who sent in their examples in response to my January request. It is incredibly helpful to be able to look at what you all are doing with Excel! Not only did I see a huge variety in how Excel is being used, you also pointed out various tips and tricks for writing fast VBA code in Excel.&lt;/P&gt;
&lt;P&gt;In this post I'm going to share with you the most important performance tips I know about. There are tons of sites, pages, and people who are experts as well on this subject, have performed their own tests, and shared their results and ideas. If you think I missed an important concept for how to optimize Excel VBA performance, or if you've got a valuable comment or link to share, please feel free to post here so everyone can benefit. Thanks!&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Turn Off Everything But the Essentials While Your Code is Running&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;This optimization explicitly turns off Excel functionality you don't need to happen (over and over and over) while your code runs. Note that in the code sample below we grab the current state of these properties, turn them off, and then restore them at the end of code execution.&lt;/P&gt;
&lt;P&gt;One reason this helps is that if you're updating (via VBA) several different ranges with new values, or copy / pasting from several ranges to create a consolidated table of data, you likely do not want to have Excel taking time and resources to recalculate formulas, display paste progress, or even redraw the grid, especially &lt;I&gt;after every single operation &lt;/I&gt;(even more so if your code uses loops). Just one recalculation and one redraw at the end of your code execution is enough to get the workbook current with all your changes.&lt;/P&gt;
&lt;P&gt;Here's some sample code that shows how and what to shut off while your code runs. Doing this should help improve the performance of your code:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;'Get current state of various Excel settings; put this at the beginning of your code&lt;/P&gt;
&lt;P&gt;screenUpdateState = Application.ScreenUpdating&lt;/P&gt;
&lt;P&gt;statusBarState = Application.DisplayStatusBar&lt;/P&gt;
&lt;P&gt;calcState = Application.Calculation&lt;/P&gt;
&lt;P&gt;eventsState = Application.EnableEvents&lt;/P&gt;
&lt;P&gt;displayPageBreakState = ActiveSheet.DisplayPageBreaks 'note this is a sheet-level setting&lt;/P&gt;
&lt;P&gt;'turn off some Excel functionality so your code runs faster&lt;/P&gt;
&lt;P&gt;Application.ScreenUpdating = False&lt;/P&gt;
&lt;P&gt;Application.DisplayStatusBar = False&lt;/P&gt;
&lt;P&gt;Application.Calculation = xlCalculationManual&lt;/P&gt;
&lt;P&gt;Application.EnableEvents = False&lt;/P&gt;
&lt;P&gt;ActiveSheet.DisplayPageBreaks = False 'note this is a sheet-level setting&lt;/P&gt;
&lt;P&gt;'&amp;gt;&amp;gt;your code goes here&amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;'after your code runs, restore state; put this at the end of your code&lt;/P&gt;
&lt;P&gt;Application.ScreenUpdating = screenUpdateState&lt;/P&gt;
&lt;P&gt;Application.DisplayStatusBar = statusBarState&lt;/P&gt;
&lt;P&gt;Application.Calculation = calcState&lt;/P&gt;
&lt;P&gt;Application.EnableEvents = eventsState&lt;/P&gt;
&lt;P&gt;ActiveSheet.DisplayPageBreaks = displayPageBreaksState 'note this is a sheet-level setting&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's a quick description for each of these settings:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application.ScreenUpdating&lt;/U&gt;: This setting tells Excel to not redraw the screen while False. The benefit here is that you probably don't need Excel using up resources trying to draw the screen since it's changing faster than the user can perceive. Since it requires lots of resources to draw the screen so frequently, just turn off drawing the screen until the end of your code execution. Be sure to turn it back on right before your code ends.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application.DisplayStatusBar&lt;/U&gt;: This setting tells Excel to stop showing status while False. For example, if you use VBA to copy/paste a range, while the paste is completing Excel will show the progress of that operation on the status bar. Turning off screen updating is separate from turning off the status bar display so that you can disable screen updating but still provide feedback to the user, if desired. Again, turn it back on right before your code ends execution.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application.Calculation&lt;/U&gt;: This setting allows you to programmatically set Excel's calculation mode. "Manual" (xlCalculationManual) mode means Excel waits for the user (or your code) to explicitly initiate calculation. "Automatic" is the default and means that Excel decides when to recalculate the workbook (e.g. when you enter a new formula on the sheet). Since recalculating your workbook can be time and resource intensive, you might not want Excel triggering a recalc every time you change a cell value. Turn off calculation while your code executes, then set the mode back. Note: setting the mode back to “Automatic” (xlCalculationAutomatic) will trigger a recalc.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application.EnableEvents&lt;/U&gt;: This setting tells Excel to not fire events while False. While looking into Excel VBA performance issues I learned that some desktop search tools implement event listeners (probably to better track document contents as it changes). You might not want Excel firing an event for every cell you're changing via code, and turning off events will speed up your VBA code performance if there is a COM Add-In listening in on Excel events. (Thanks to Doug Jenkins for pointing this out in my earlier post).&lt;/P&gt;
&lt;P&gt;&lt;U&gt;ActiveSheet.DisplayPageBreaks&lt;/U&gt;: A good description of this setting already exists: &lt;A href="http://support.microsoft.com/kb/199505" mce_href="http://support.microsoft.com/kb/199505"&gt;http://support.microsoft.com/kb/199505&lt;/A&gt; (Thanks to David McRitchie for pointing this out).&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Read/Write Large Blocks of Cells in a Single Operation&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;This optimization explicitly reduces the number of times data is transferred between Excel and your code. Instead of looping through cells one at a time and getting or setting a value, do the same operation over the whole range in one line, using an array variable to store values as needed.&lt;/P&gt;
&lt;P&gt;For each of the code examples below, I had put random values (not formulas) into cells A1:C10000.&lt;/P&gt;
&lt;P&gt;Here's a slow, looping method:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Dim DataRange as Range &lt;BR&gt;Dim Irow as Long &lt;BR&gt;Dim Icol as Integer &lt;BR&gt;Dim MyVar as Double &lt;BR&gt;Set DataRange=Range("A1:C10000") &lt;BR&gt;&lt;BR&gt;For Irow=1 to 10000 &lt;BR&gt;&amp;nbsp; For icol=1 to 3 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyVar=DataRange(Irow,Icol)&amp;nbsp; 'Read values from the Excel grid 30K times &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If MyVar &amp;gt; 0 then&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyVar=MyVar*Myvar ' Change the value&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRange(Irow,Icol)=MyVar&amp;nbsp; 'Write values back into the Excel grid 30K times &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&amp;nbsp; &lt;BR&gt;&amp;nbsp; Next Icol &lt;BR&gt;Next Irow&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's the fast version of that code:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Dim DataRange As Variant &lt;BR&gt;Dim Irow As Long &lt;BR&gt;Dim Icol As Integer &lt;BR&gt;Dim MyVar As Double &lt;BR&gt;DataRange = Range("A1:C10000").Value ' read all the values at once from the Excel grid, put into an array &lt;BR&gt;&lt;BR&gt;For Irow = 1 To 10000 &lt;BR&gt;&amp;nbsp; For Icol = 1 To 3 &lt;BR&gt;&amp;nbsp; MyVar = DataRange(Irow, Icol) &lt;BR&gt;&amp;nbsp; If MyVar &amp;gt; 0 Then &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyVar=MyVar*Myvar ' Change the values in the array &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRange(Irow, Icol) = MyVar &lt;BR&gt;&amp;nbsp; End If &lt;BR&gt;Next Icol &lt;BR&gt;Next Irow &lt;BR&gt;Range("A1:C10000").Value = DataRange ' writes all the results back to the range at once&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note: I first learned of this concept by reading a web page by John Walkenbach found here: &lt;A href="http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/" mce_href="http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/"&gt;http://www.dailydoseofexcel.com/archives/2006/12/04/writing-to-a-range-using-vba/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A previous Excel blog entry by Dany Hoter also compares these two methods, along with a selection / offset method as well: &lt;A href="http://blogs.msdn.com/excel/archive/2008/10/03/what-is-the-fastest-way-to-scan-a-large-range-in-excel.aspx" mce_href="http://blogs.msdn.com/excel/archive/2008/10/03/what-is-the-fastest-way-to-scan-a-large-range-in-excel.aspx"&gt;http://blogs.msdn.com/excel/archive/2008/10/03/what-is-the-fastest-way-to-scan-a-large-range-in-excel.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;...which leads me to my next point.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Avoid Selecting / Activating Objects&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Notice that in the above-referenced blog post, the selection method of updating a range was the slowest. This next optimization minimizes how frequently Excel has to respond to the selection changing in the workbook by minimizing the selection changing as much as possible.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Range Example&lt;/U&gt;: Again, see the Excel blog post quoted above. It demonstrates that using selection is the slowest of the 3 methods discussed for reading and writing to ranges.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Shapes Example&lt;/U&gt;: Setup: I have 40 shapes on a sheet, and I want to write "Hello" in each of them.&lt;/P&gt;
&lt;P&gt;Using the slower "selection" method, the code looks like this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;For i = 0 To ActiveSheet.Shapes.Count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ActiveSheet.Shapes(i).Select&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Selection.Text = "Hello"&lt;/P&gt;
&lt;P&gt;Next i&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The much faster method is to avoid selection completely and directly reference the shape:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;For i = 0 To ActiveSheet.Shapes.Count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ActiveSheet.Shapes(i).TextEffect.Text = "Hello"&lt;/P&gt;
&lt;P&gt;Next i&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The concepts illustrated by the examples above can also be applied to objects other than Ranges and Shapes.&lt;/P&gt;
&lt;P&gt;Note: I first learned of this concept, in the context of shapes, by reading a web page by Ron de Bruin found here: &lt;A href="http://www.rondebruin.nl/shape.htm" mce_href="http://www.rondebruin.nl/shape.htm"&gt;http://www.rondebruin.nl/shape.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Related Performance Paper&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;See the&lt;B&gt; &lt;/B&gt;"Improving Performance in Excel 2007" paper on MSDN: &lt;A href="http://msdn.microsoft.com/en-us/library/aa730921.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa730921.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa730921.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a fairly detailed and comprehensive paper that introduces the bigger grid and increased limits in Excel 2007, and primarily focuses on Excel calculation performance and debugging calculation performance bottlenecks. There's also a short section on how to write faster VBA macros.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Other Performance Optimizations&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;While the above optimizations are what I consider the most important, there are a few other "honorable mention" optimizations I will mention briefly for you to consider.&lt;/P&gt;
&lt;P&gt;Consider the performance gains by implementing your code's functionality via XLL / C-API. An overview and supporting materials for the SDK can be found here: &lt;A href="http://msdn.microsoft.com/en-us/library/bb687827.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb687827.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb687827.aspx&lt;/A&gt; .&lt;/P&gt;
&lt;P&gt;Declare variables with explicit types to avoid the overhead of determining the data type (repetitively if used in a loop) during code execution.&lt;/P&gt;
&lt;P&gt;For simple functions used by your code in high frequency, implement them yourself in VBA instead of using the WorksheetFunction object.&lt;/P&gt;
&lt;P&gt;Use Range.SpecialCells() to scope down the number of cells your code needs to work with.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9472352" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Programmability" scheme="http://blogs.msdn.com/excel/archive/tags/Programmability/default.aspx" /><category term="Performance" scheme="http://blogs.msdn.com/excel/archive/tags/Performance/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>Creating Dynamic Validation Ranges</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/03/05/creating-dynamic-validation-ranges.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="7443" href="http://blogs.msdn.com/excel/attachment/9460917.ashx" /><id>http://blogs.msdn.com/excel/archive/2009/03/05/creating-dynamic-validation-ranges.aspx</id><published>2009-03-05T22:46:00Z</published><updated>2009-03-05T22:46:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s author, Dany Hoter, a Product Planner for the Excel team, shares a neat trick he learned recently for creating dynamic data validation ranges.&amp;nbsp; The sample file used for this blog post can be found in the attachments at the bottom of this post.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt; Validating data entry based on hierarchical (parent child) data. The example used is regions and countries but it could be countries and cities, product categories and sub-categories, class and student name, etc. &lt;/P&gt;
&lt;P&gt;You want to enter a region from a list of regions and in the next cell you want to select a country but only from the countries which belong to that region.&lt;/P&gt;
&lt;P&gt;How do you define the list of countries to validate against? The trick is basing the country validation list on an expression which will point to a different range based on the region value. &lt;/P&gt;
&lt;P&gt;Follow the instructions in the file itself (attached below) and see how it works. &lt;/P&gt;
&lt;P&gt;Points to notice:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In Step 2 named ranges are created automatically based on a selected range.&lt;/LI&gt;
&lt;LI&gt;The named range used for country validation uses relative reference to point to the list of values. In this way the same mechanism will work anywhere in the spreadsheet. The validation of the cell with country is based on the region value to the left of country. The actual expression is =INDIRECT(B13). For example the named range for countries in Europe is Europe. The indirect function uses the value of the region to point the relevant named range. B13 happens to be the cell to the left of the current cell when defining the name.&lt;/LI&gt;
&lt;LI&gt;The validation rules are propagated automatically to each new row in the table.&lt;/LI&gt;
&lt;LI&gt;The lists of regions and countries do not have to be in the same worksheet as the input cells.&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9460917" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /><category term="Data Validation" scheme="http://blogs.msdn.com/excel/archive/tags/Data+Validation/default.aspx" /><category term="Power Tips" scheme="http://blogs.msdn.com/excel/archive/tags/Power+Tips/default.aspx" /></entry><entry><title>How to Create a Professional Chart using Excel 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/02/24/how-to-create-a-professional-chart-using-excel-2007.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/02/24/how-to-create-a-professional-chart-using-excel-2007.aspx</id><published>2009-02-25T03:34:00Z</published><updated>2009-02-25T03:34:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;&lt;EM&gt;Today's author, Robin Wakefield, a Program Manager on the Excel team, discusses charts.&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;As a new program manager in Excel one of my first tasks was to understand what problems users encounter when building professional charts in Excel. I defined professional as following the principles of Edward Tufte by reducing the amount of non-data ink on a chart. On an earlier &lt;A href="http://blogs.msdn.com/excel/archive/2006/04/11/573482.aspx" mce_href="http://blogs.msdn.com/excel/archive/2006/04/11/573482.aspx"&gt;post&lt;/A&gt;, there were a lot of comments about this particular aspect and I agree we could do better in helping users accomplish this goal. I also looked at blogs and publications which were known to produce professional looking charts to determine what the salient aspects were. As I researched this further I found there were a lot of remarks on the web that pertained to Excel 2003 charting so I thought it would be worthwhile to share what I found; specifically what changes you can make to a default chart in Excel 2007 to make it more professional looking. Your feedback on this would be greatly appreciated as we are considering how we can build this into the product going forward.&lt;/P&gt;
&lt;P&gt;In order to illustrate this let’s try to recreate a chart I found in the Wall Street Journal.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_2.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=178 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb.png" width=266 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I manually created the data so it may be a little off but when I insert a column chart Excel creates the following default chart for me. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_4.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=265 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb_1.png" width=406 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In order to make this chart look more professional like the Wall Street Journal you can make the following modifications.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 1: Update Formatting Settings &lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;With the chart selected click the Formatting tab on the Ribbon. In the left corner you can choose the chart object you would like to format and click "Format Selection" to get the formatting dialog for the object. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/clip_image004_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/clip_image004_2.jpg"&gt;&lt;IMG title=clip_image004 style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=118 alt=clip_image004 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/clip_image004_thumb.jpg" width=164 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/clip_image004_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Chart Area&lt;/B&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set Border Color = No Line.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Vertical Value Axis&lt;/B&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In order to keep your scale the same regardless of changes in the size of chart set the minimum, maximum and major unit options to fixed amounts.&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Minimum = –.1&lt;/LI&gt;
&lt;LI&gt;Maximum = .08&lt;/LI&gt;
&lt;LI&gt;Major Unit = .02&lt;B&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Set Line Color = No Line&lt;B&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Vertical (Value) Axis Major Gridlines&lt;/B&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set Line Style = Dash type to deemphasize the gridlines as they are helpful in understanding the data but not the emphasis of your chart.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Horizontal Category Axis&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set Axis Labels = Low &lt;/LI&gt;
&lt;LI&gt;Set Major Tick Mark = None &lt;/LI&gt;
&lt;LI&gt;Label distance from axis = 0&lt;/LI&gt;
&lt;LI&gt;Uncheck Multi-Level Category Labels &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Series 1&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set Gap Width ≈ 34%&lt;/LI&gt;
&lt;LI&gt;Fill = Solid Color and choose a red color to match the WSJ chart&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 2: Update Font Size&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Select the chart and on your home tab select a font size which is large enough that you can still read the words but they are not the emphasis of your chart. In this example I set the font size to 8. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 3: Remove Legend&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Given the example only has one data series the legend is unnecessary in this case. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 4: Add Title&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Add a title to the chart to tell your reader what the chart represents. In order to mimic the Wall Street Journal chart you need to move your title to the upper left hand corner and set the alignment to left. You also need to format the text so the title is in a larger font and bold whereas the subtitle is in a smaller font.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 5: Add captions&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In order to add the citation you need to manually add a text box with this information to your chart.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Step 6: Add a Vertical Axis Title&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In order to display the units of the vertical axis without showing a % next to each number on the axis the best way to do this is to add a vertical axis title and enter %. You can then move this title to line up with first number on the vertical axis.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_6.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=213 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb_2.png" width=333 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_E56C/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see I was able to get pretty close to the original chart by changing formatting settings and adding some additional text. The thing I was not able to accomplish without a hacky workaround was to fill only the bottom portion of the plot area with a gray color.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Avoid Unessential Formatting&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Throughout this article I have focused on what changes you can make to the default chart but I would like to take a moment to discuss the principle of avoiding unessential formatting. As part of Office 2007 the concept of Themes was introduced. This was an Office wide effort and is shared across Word, PowerPoint, and Excel. For more information about themes and how they work in Excel see this &lt;A href="http://blogs.msdn.com/excel/archive/2006/03/23/559600.aspx" mce_href="http://blogs.msdn.com/excel/archive/2006/03/23/559600.aspx"&gt;post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Within each Theme there are multiple Chart Styles available which is described &lt;A href="http://blogs.msdn.com/excel/archive/2006/04/12/575409.aspx" mce_href="http://blogs.msdn.com/excel/archive/2006/04/12/575409.aspx"&gt;here&lt;/A&gt;. The way this works is the chart styles are predefined to map to accent colors, fills, and effects etc which are defined in the Theme. When a new theme is added the chart styles are automatically generated based on the Theme definition. Although this was a great way to produce many choices for users it had an unfortunate side effect in that some of the effects/fills are not optimized for charting as they are also used on shapes, smart art etc.&lt;/P&gt;
&lt;P&gt;See the styles matrix below for an example of the styles that are created based on the Office Theme definition.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/image_6.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=295 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/image_thumb_2.png" width=632 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/HowtoCreateaProfessionalChartusingExcel2_10FDD/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In order to reduce the amount of non-data ink I would recommend sticking to the first row of styles as they do not have any effects applied to them. As you move down the rows, effects get more intense and in some themes the effects make the chart unusable such as the Metro theme which adds a glow around the columns.&lt;/P&gt;
&lt;P&gt;Within one row we provide a variety of color options as well. The first option is always a grayscale and this will be your best choice to reduce the amount of non-data ink. The second option is all 6 accent colors in the Theme and options 3-8 produce a monochrome chart based on one of the accent colors.&lt;/P&gt;
&lt;P&gt;If you would like to add color to your chart the following themes are good options for color variety where the colors are differentiated but no one color stands out from the others.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Office &lt;/LI&gt;
&lt;LI&gt;Civic &lt;/LI&gt;
&lt;LI&gt;Median &lt;/LI&gt;
&lt;LI&gt;Paper &lt;/LI&gt;
&lt;LI&gt;Technic &lt;/LI&gt;
&lt;LI&gt;Trek &lt;/LI&gt;
&lt;LI&gt;Urban &lt;/LI&gt;
&lt;LI&gt;Origin&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Another great resource to help choose the right chart type for your data and programmatically determine when some of the above changes should be applied is the Chart Advisor. Check out the post &lt;A href="http://blogs.msdn.com/excel/archive/2008/09/25/chart-advisor.aspx" mce_href="http://blogs.msdn.com/excel/archive/2008/09/25/chart-advisor.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9443511" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Charting" scheme="http://blogs.msdn.com/excel/archive/tags/Charting/default.aspx" /><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /></entry><entry><title>Simple Expense Tracking With New Excel 2007 Functions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/02/09/simple-expense-tracking-with-new-excel-2007-functions.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/02/09/simple-expense-tracking-with-new-excel-2007-functions.aspx</id><published>2009-02-10T01:08:00Z</published><updated>2009-02-10T01:08:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s author, Monica Poinescu, a Software Developer in Test on the Excel team, gives an overview of some new functions in Excel 2007 and along the way shows us how to do some simple expense tracking.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Considering the current economic environment, one may desire to better keep track of personal expenses. The new functions introduced in Office Excel 2007 simplify this effort. Here is how: given a list of expenses sorted by dates and categories (food, travel, clothing, etc.), how do I find how much was spent for each category, per month? And what’s the average amount spent? The functions SUMIFS, AVERAGEIFS and COUNTIFS perform selective calculations: they take into account only those values which fulfill several criteria. The values could be in a range spanning several rows and columns.&lt;/P&gt;
&lt;P&gt;Let’s assume I entered the expenses in a table:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_2.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=177 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb.png" width=249 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The solution below uses the new Excel 2007 feature &lt;A href="http://office.microsoft.com/en-us/excel/HA101556861033.aspx?pid=CH100648431033" mce_href="http://office.microsoft.com/en-us/excel/HA101556861033.aspx?pid=CH100648431033"&gt;structured references&lt;/A&gt;; see &lt;A href="http://blogs.msdn.com/excel/archive/2005/10/28/486604.aspx" mce_href="http://blogs.msdn.com/excel/archive/2005/10/28/486604.aspx"&gt;'Tables Part 3: Using Formulas with Tables'&lt;/A&gt; for more details on how to simplify your formulas based on tables.&lt;/P&gt;
&lt;P&gt;I’m also using the function SUMIFS which extends the functionality of SUMIF: given a range to be summed, it will add only those values that fulfill all the given criteria (one could use between 1 and 127 criteria applied to corresponding ranges).&lt;/P&gt;
&lt;P&gt;The syntax is SUMIFS( the_range_to_sum, range_to_apply_criteria1, criteria1, [range_to_apply_criteria2, criteria2], … ) where the first parameter tells Excel what range we want to sum and the following pairs of arguments tell Excel on which range to apply the respective condition. &lt;/P&gt;
&lt;P&gt;In visual terms, I think of each pair (range_to_apply_criteria1, criteria1) as a &lt;A href="http://office.microsoft.com/en-us/templates/TC010187241033.aspx?pid=CT101443391033" mce_href="http://office.microsoft.com/en-us/templates/TC010187241033.aspx?pid=CT101443391033"&gt;punch card&lt;/A&gt; &lt;BR&gt;with some (0 or more) perforations, in the places where the criteria is TRUE. Stack all these cards on top of each other, the_range_to_sum being on the bottom, and SUMIFS adds only the values that remain visible.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Then start building your reports table by entering in F1:I3 the categories and the months:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_4.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=72 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb_1.png" width=254 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;and in G2 enter:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;=SUMIFS( Table1[Amount], Table1[Category], G$1, Table1[Date], $F2 )&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;which will evaluate the ‘home’ expenses for January (235.35).&lt;/P&gt;
&lt;P&gt;It should look like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_6.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=208 alt=image src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb_2.png" width=604 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/SimpleExpenseTracking_EE7C/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Similarly, in H2 enter:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;=SUMIFS( Table1[Amount], Table1[Category], H$1, Table1[Date], $F2 ) &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;this will evaluate the ‘food’ expenses for January .&lt;/P&gt;
&lt;P&gt;And in I2 enter:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;=SUMIFS( Table1[Amount], Table1[Category], I$1, Table1[Date], $F2 ) &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;to get your travel related amount.&lt;/P&gt;
&lt;P&gt;You can copy/paste these formulas down as you add more months. This will automatically take into account new entries in your expense list. Also, in case you need to figure the average expense per category, within each month, you can use: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;=AVERAGEIFS( Table1[Amount], Table1[Category], "home", Table1[Date], "January" ) - this returns 117.675&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9409674" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Formulas and functions" scheme="http://blogs.msdn.com/excel/archive/tags/Formulas+and+functions/default.aspx" /><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /></entry><entry><title>Quick and Easy Data Access with Excel Services</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/02/05/quick-and-easy-data-access-with-excel-services.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/02/05/quick-and-easy-data-access-with-excel-services.aspx</id><published>2009-02-06T02:49:00Z</published><updated>2009-02-06T02:49:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;Today’s author, John Campbell, a Program Manager on the Excel Services team, shows us the quick and easy way to get external data access working with your Excel Services spreadsheets.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I have seen a lot of great blog posts that tell folks how to do great things with refreshed data in an Excel spreadsheet using Excel Services. I’ve seen posts about slicing dashboard pages, about using .odc files to manage data, and more. One thing that continues to be an issue is how to get connected to that data in the first place, in way that will work on Excel Services. The key is all about ‘telling the server’ what user identity to use when connecting to your data source. I know a number of people have gotten over this hump, but there are a lot of others who struggle here. In this posting I will shed some light on why the server works the way it does here, and show you the easiest way to get this up and running. I’m abbreviating in this post – so I’m not going to cover every last detail, option, and scenario here. If you want a lot more detail, and want to go deeper on why, and other options I don’t talk about here, then see the whitepaper I wrote on the topic: &lt;A href="http://technet.microsoft.com/en-us/library/cc262899.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc262899.aspx"&gt;http://technet.microsoft.com/en-us/library/cc262899.aspx&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;First, some quick terminology and background:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Credentials:&lt;/B&gt; The log in name/password of a user. These are used to establish your identity to the larger network/system.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Authentication:&lt;/B&gt; ‘Who you are’ – this is how the system verifies your identity.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Authorization:&lt;/B&gt; ‘What you can do’ – this is the process of the system determining what rights or permissions you have.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Connection String:&lt;/B&gt; This is a string, typically stored in a workbook or .odc file, which has the basic information needed to connect to a data source. It contains things like what server to use, how to authenticate, along with any special parameters that are needed to form the raw connection to the database.&lt;/P&gt;
&lt;P&gt;Your goal is to get the user, who is viewing your spreadsheet in their browser, authenticated and authorized against the data source. (After all, your cool report showing sales figures sliced by time won’t be worth much if you can’t refresh the data to see the current numbers.) To be more specific, I am talking about getting an identity to use for authentication/authorization from the Excel Calculation Server (ECS) to the data source (circled in the picture):&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image002_2.jpg"&gt;&lt;IMG title=clip_image002 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=159 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image002_thumb.jpg" width=558 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Connection strings will typically contain information about how to authenticate to the data source, but, for various reasons, Excel Services can’t parse them to determine how to perform the authentication. So the user must explicitly set how the authentication is to be performed. There are three options for this: Windows (delegate your domain credentials to each box on the way to, and including, the data source), SSO (lookup a username/password combo to use on your behalf out of an Single Sign On database in SharePoint), or None (no specific options are set – just take the connection string and give it a try). By default, the Windows authentication is attempted because A) it is the most secure, and B) it has the best chance of working, assuming Kerberos is configured in a typical environment, without somebody (the administrator of the server or database) needing to do something special to make it work.&lt;/P&gt;
&lt;P&gt;Ok, enough with the background info. So, you say you can’t setup Kerberos and don’t want to spend a bunch of time getting into details of authentication - so what’s the easiest thing to do? The rest of this blog is about how to configure the None option, and related server switches, to get external data refresh working on Excel Services.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 1: Configure the unattended account in the Excel Services administration page.&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The unattended account is really just a set of credentials that Excel Services impersonates &lt;I&gt;before &lt;/I&gt;certain types of external data connections are made. Think of it as a dummy user account that Excel Services keeps around for connecting to data. By default, many connection strings (like connections to SQL or Analysis Services), are configured to use whatever identity is available in the process at the time the connection is made. What all that boils down to is, if the connection string specifies that integrated security is used, then the identity of the unattended account will be used at the data source for authentication/authorization. &lt;/P&gt;
&lt;P&gt;So here is how to do it:&lt;/P&gt;
&lt;P&gt;On the server box, go to the Excel Services admin page: From the taskbar, click &lt;STRONG&gt;Start&lt;/STRONG&gt;, point to &lt;STRONG&gt;All Programs&lt;/STRONG&gt;, point to &lt;STRONG&gt;Microsoft Office Server&lt;/STRONG&gt;, and then click &lt;STRONG&gt;SharePoint 3.0 Central Administration.&lt;/STRONG&gt; Select the name of the SSP from the left-hand navigation bar. For example, SharedServices1 as shown.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image003_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image003_2.jpg"&gt;&lt;IMG title=clip_image003 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=308 alt=clip_image003 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image003_thumb.jpg" width=239 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image003_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Then, click Edit Excel Service Settings. Then scroll down and find the Unattended Account settings.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image004_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image004_2.jpg"&gt;&lt;IMG title=clip_image004 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=276 alt=clip_image004 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image004_thumb.jpg" width=295 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image004_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Enter in the name and password of an account that has access to the data sources you are planning to access, and click OK. &lt;/P&gt;
&lt;P&gt;A few things to pay special attention to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If any other users want to use this account for their data refresh, they will need to make sure it has access to their data sources. &lt;/LI&gt;
&lt;LI&gt;Security is important! You should &lt;I&gt;&lt;U&gt;&lt;FONT color=#ff0000&gt;never&lt;/FONT&gt;&lt;/U&gt;&lt;/I&gt; use an account that has access to the SQL databases that are running your SharePoint farm. If the unattended account does have access to SharePoint, then it becomes possible for users to load a workbook on the server that connects directly to the SharePoint databases, bypassing most SharePoint security.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Step 2: Configure the data connection in workbook&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;From the Excel Data ribbon, in the &lt;STRONG&gt;Connections&lt;/STRONG&gt; section, click &lt;STRONG&gt;Connections&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image005_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image005_2.jpg"&gt;&lt;IMG title=clip_image005 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=121 alt=clip_image005 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image005_thumb.jpg" width=151 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image005_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the &lt;STRONG&gt;Workbook Connections&lt;/STRONG&gt; dialog box, which shows all the external data connections that are currently being used by the workbook, select the connection that needs to be changed, and then click &lt;STRONG&gt;Properties&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image006_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image006_2.jpg"&gt;&lt;IMG title=clip_image006 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=142 alt=clip_image006 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image006_thumb.jpg" width=548 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image006_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the &lt;STRONG&gt;Connection Properties&lt;/STRONG&gt; dialog box, which allows many properties of the connection to be changed, click the &lt;STRONG&gt;Definition&lt;/STRONG&gt; tab.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image007_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image007_2.jpg"&gt;&lt;IMG title=clip_image007 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=510 alt=clip_image007 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image007_thumb.jpg" width=418 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image007_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Click the &lt;STRONG&gt;Authentication Settings&lt;/STRONG&gt; button.&lt;/P&gt;
&lt;P&gt;From the &lt;STRONG&gt;Excel Services Authentication&lt;/STRONG&gt; dialog box, select the &lt;B&gt;None&lt;/B&gt; option.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image009_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image009_2.jpg"&gt;&lt;IMG title=clip_image009 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=287 alt=clip_image009 src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image009_thumb.jpg" width=309 border=0 mce_src="http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/95eced07240d_10557/clip_image009_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Now just click &lt;STRONG&gt;OK&lt;/STRONG&gt; on the various dialogs until you are back to your spreadsheet.&lt;/P&gt;
&lt;P&gt;That’s all you need to do. Also note that with this None setting, if you use something like SQL authentication where a username and password are saved in a connection string, then SQL (or other data providers) &lt;I&gt;should &lt;/I&gt;use those credentials to connect to the data. I say should, because Excel and Excel Services doesn’t control this – whether that username/password gets used is completely up to the specific implementation of the data provider.&lt;/P&gt;
&lt;P&gt;If you want more information about why authentication works this way, more details about the other options, more information about managing data connections, or prescriptive guidance and Q&amp;amp;A’s in this area - then see the whitepaper, where I go much deeper, at &lt;A href="http://technet.microsoft.com/en-us/library/cc262899.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc262899.aspx"&gt;http://technet.microsoft.com/en-us/library/cc262899.aspx&lt;/A&gt; .&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9400620" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Excel Server" scheme="http://blogs.msdn.com/excel/archive/tags/Excel+Server/default.aspx" /><category term="PivotTables" scheme="http://blogs.msdn.com/excel/archive/tags/PivotTables/default.aspx" /><category term="Analysis Services" scheme="http://blogs.msdn.com/excel/archive/tags/Analysis+Services/default.aspx" /><category term="How To" scheme="http://blogs.msdn.com/excel/archive/tags/How+To/default.aspx" /></entry><entry><title>New Case Study Involving Excel Services</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/excel/archive/2009/02/02/new-case-study-involving-excel-services.aspx" /><id>http://blogs.msdn.com/excel/archive/2009/02/02/new-case-study-involving-excel-services.aspx</id><published>2009-02-02T19:19:00Z</published><updated>2009-02-02T19:19:00Z</updated><content type="html">&lt;P&gt;A new case study has been published that describes how Microsoft IT used Excel Services to build a portal for finance data.&amp;nbsp; Here's a snippet from TechNet:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Controller Workspace: Connecting With Excel Services in Microsoft Office SharePoint Server 2007&lt;BR&gt;&lt;/STRONG&gt;Describes how Microsoft IT created a centralized user interface platform, called Controller Workspace, that enables users to view reports, key performance indicators (KPIs), and other finance data. Out-of-box features of Microsoft Office 2007 Excel Services in Office SharePoint Server 2007 provide the foundation for the centralized portal.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The case study can be found &lt;A class="" href="http://technet.microsoft.com/en-us/library/dd433177.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd433177.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; There is a video demonstration at the link as well.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9391231" width="1" height="1"&gt;</content><author><name>Joseph Chirilov</name><uri>http://blogs.msdn.com/members/Joseph+Chirilov.aspx</uri></author><category term="Excel Server" scheme="http://blogs.msdn.com/excel/archive/tags/Excel+Server/default.aspx" /></entry></feed>