<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx</link><description>Today’s author, Chad Rothschiller, a Program Manager on the Excel team, is back with a follow up from his previous post on VBA and Excel performance . I want to start off this post by thanking everyone who sent in their examples in response to my January</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Anith &amp;raquo; Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9472521</link><pubDate>Fri, 13 Mar 2009 04:53:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9472521</guid><dc:creator>Anith &amp;raquo; Excel VBA Performance Coding Best Practices</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.anith.com/?p=18366"&gt;http://www.anith.com/?p=18366&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9472566</link><pubDate>Fri, 13 Mar 2009 05:33:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9472566</guid><dc:creator>sam</dc:creator><description>&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;I thought it was the other way around....where ever possible use built in functions rather than the other way around...&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9472708</link><pubDate>Fri, 13 Mar 2009 08:02:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9472708</guid><dc:creator>sam</dc:creator><description>&lt;p&gt;Dont declare variables as Integer Data types&lt;/p&gt;
&lt;p&gt;From VB6 onwards they get converted in to Long any way... so declare them as long&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9472864</link><pubDate>Fri, 13 Mar 2009 11:33:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9472864</guid><dc:creator>Doug Jenkins</dc:creator><description>&lt;p&gt;Sam - &amp;quot;I thought it was the other way around....where ever possible use built in functions rather than the other way around...&amp;quot;&lt;/p&gt;
&lt;p&gt;Yes, use built in VBA functions, but for Excel functions that do not have a VBA equivalent it is about 10 times quicker (in XL 2007) to write your own, rather than use worksheetfunction.&lt;/p&gt;
&lt;p&gt;In previous versions the speed hit was about 3X. &amp;nbsp;There must be some scope there for at least getting back to where we used to be.&lt;/p&gt;
&lt;p&gt;More details at:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://newtonexcelbach.wordpress.com/2008/02/23/worksheetfunction-vs-udf/"&gt;http://newtonexcelbach.wordpress.com/2008/02/23/worksheetfunction-vs-udf/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://newtonexcelbach.wordpress.com/2008/05/24/worksheetfunction-vs-udf-2/"&gt;http://newtonexcelbach.wordpress.com/2008/05/24/worksheetfunction-vs-udf-2/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Re: Discovering functionality via John Walkenbach's blog</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9473061</link><pubDate>Fri, 13 Mar 2009 15:19:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9473061</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Surely MS Program Managers shouldn't be learning about fundamental functions in their programs...from blog posts?&lt;/p&gt;
&lt;p&gt;Aren't you guys meant to, you know, have the inside track on these things?&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9473624</link><pubDate>Fri, 13 Mar 2009 23:35:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9473624</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;Nice post, thank you. I always used the &amp;quot;trick &amp;quot; to turn off unnecessary functionality during calculations, but your list looks much more exhaustive!&lt;/p&gt;
&lt;p&gt;Oh , and a good way to enforce explicit variable declaration is to systematically add &amp;quot;option explicit&amp;quot; on top of the modules.&lt;/p&gt;
</description></item><item><title>Turning things off</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9473897</link><pubDate>Sat, 14 Mar 2009 03:00:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9473897</guid><dc:creator>kurt.thomas</dc:creator><description>&lt;p&gt;Great list! But remember to also point your error handler at the code that will restore state, otherwise if there is an error, you just leave it all up to Excel to restore.&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9473918</link><pubDate>Sat, 14 Mar 2009 03:07:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9473918</guid><dc:creator>Clippy :)</dc:creator><description>&lt;p&gt;Gordon, do you as well expect that the designed and engineers behind F-1 cars and fighter jets are THE best drivers and THE best pilots? :))&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9475305</link><pubDate>Sat, 14 Mar 2009 13:28:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9475305</guid><dc:creator>sam</dc:creator><description>&lt;p&gt;&amp;quot;Range.SpecialCells() to scope down the number of cells your code needs to work with&amp;quot;&lt;/p&gt;
&lt;p&gt;But always check for 8192 areas - Expecially with 2007....Its only the grid thats got bigger...not the other associated limits&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9476372</link><pubDate>Sat, 14 Mar 2009 20:51:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9476372</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;@Clippy&lt;/p&gt;
&lt;p&gt;No, but if they were posting a blog post called &amp;quot;How best to drive F1 cars/fly fighter jets&amp;quot; I wouldn't expect that they would admit to recently learning that &amp;quot;I found out on a blog post that it's best to go in slow, fast out&amp;quot; and, erm whatever the equivalent in fighter jet technique might be!&lt;/p&gt;
&lt;p&gt;Loading a range into a variant as opposed to using a loop is covered in Excel 101, and all I was doing is expressing surprise that anyone who has such an intimate relationship with Excel wouldn't realise that telling world+dog that they didn't have even a basic grasp on their own product might reinforce negative impressions that people might already have about MS and their development culture, and the poorly-regarded software that sometimes results.&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9480694</link><pubDate>Mon, 16 Mar 2009 08:07:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9480694</guid><dc:creator>sam</dc:creator><description>&lt;p&gt;Gordon...&lt;/p&gt;
&lt;p&gt;&amp;quot;they didn't have even a basic grasp on their own product&amp;quot;&lt;/p&gt;
&lt;p&gt;Go through this entire blog...Exclude post on a)Excel Services&lt;/p&gt;
&lt;p&gt;b)Sharepoint&lt;/p&gt;
&lt;p&gt;c)posts on more rows, more columns, more colors , more nested ifs ...in 007&lt;/p&gt;
&lt;p&gt;and show me one post related to Excel(+VBA) which has NEW content ...something not posted on other blogs, newsgroups, books etc...&lt;/p&gt;
&lt;p&gt;I mentioned earlier...I learn more from the comments than from the main post...&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9482380</link><pubDate>Tue, 17 Mar 2009 07:01:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9482380</guid><dc:creator>Tom Bizannes</dc:creator><description>&lt;p&gt;Wow, this is kind of dangerous!&lt;/p&gt;
&lt;p&gt;I mean specifically turning off calculation!&lt;/p&gt;
&lt;p&gt;If you are copying values all around which are changed by formulae, you will get some erroneous results. This this happens more than not in the large spreadsheets we have to manipulate for clients aroudn the globe....&lt;/p&gt;
&lt;p&gt;Other items , like screen updating sure makes an app run faster, but clients like to see movement and so you need to make sure the status bar reflects what's going on....&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9484116</link><pubDate>Tue, 17 Mar 2009 20:10:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9484116</guid><dc:creator>Chad Rothschiller</dc:creator><description>&lt;p&gt;Regarding F-1 cars, fighter jets, and Excel 101: I wanted to post a note to give some more context on the research I did that I hope will help frame a better understanding of why I attributed some of my findings to other people.&lt;/p&gt;
&lt;p&gt;It starts and ends with the customer. For me and this bit of research, it started in the context of what people, our customers, are doing with Excel. After hearing that Excel 2007 was slower in some scenarios, I hit as many avenues as I could to get good feedback / examples so we could debug the issues and see what people were running into most frequently. I sent emails to people I know, wrote on the Excel blog, and searched the internet, looking and asking for examples.&lt;/p&gt;
&lt;p&gt;In the natural course of this process, I came across examples of the slowdowns *and* what people were doing to mitigate them. As I interacted with a wide variety of people I realized that while some were experts, others would probably appreciate and benefit from a clear and simple statement of the basics of best practices in VBA coding.&lt;/p&gt;
&lt;p&gt;Once I wrote the content for this post, I sent it around to several other folks here on the Excel team for review. They confirmed that I had addressed the classic / basic cases and hadn't missed any big areas.&lt;/p&gt;
&lt;p&gt;Before posting I did take some time to consider whether or not I should claim that I had singlehandedly come up with the mitigations and workarounds for everyone, even though most of the examples, issues, and discussion of the solutions took place with other people, our customers, in the context of their work. I had a hunch that referencing other people's work might open up a can of worms, but in the end I decided that it was the right thing to do, since it more accurately reflects the conversations I had with people.&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9485114</link><pubDate>Wed, 18 Mar 2009 02:20:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9485114</guid><dc:creator>Nate Oliver</dc:creator><description>&lt;p&gt;&amp;quot;Wow, this is kind of dangerous!&lt;/p&gt;
&lt;p&gt;I mean specifically turning off calculation!&amp;quot;&lt;/p&gt;
&lt;p&gt;Note that this blog entry is not advising you to leave Excel in Manual Calc-mode unless you found it that way. See the following code that was presented:&lt;/p&gt;
&lt;p&gt;Application.Calculation = calcState&lt;/p&gt;
&lt;p&gt;That resets Excel's Calculation mode to the state it was found in (calcState being the variable). And, as noted here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.decisionmodels.com/calcsecretsh.htm"&gt;http://www.decisionmodels.com/calcsecretsh.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;Resetting calculation to xlCalculationAutomatic will trigger a recalculation.&amp;quot;&lt;/p&gt;
&lt;p&gt;Also, as you can see, there's a variety of ways to recalc. in a controlled, one-time manner, vs. doing it over and over again in your procedure, which really is part of the point.&lt;/p&gt;
&lt;p&gt;&amp;quot;Other items , like screen updating sure makes an app run faster, but clients like to see movement and so you need to make sure the status bar reflects what's going on....&amp;quot;&lt;/p&gt;
&lt;p&gt;It's my personal opinion that if people spent more time optimizing their code and less time building shiny status bars and code that generates a ton of screen redraw, there wouldn't be nearly as much need to do that; as your code would be so fast, it wouldn't matter.&lt;/p&gt;
&lt;p&gt;Take the following:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.utteraccess.com/forums/showthreaded.php?Number=1146152"&gt;http://www.utteraccess.com/forums/showthreaded.php?Number=1146152&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That moves 260,000 records (520,000 fields) from Access to Excel in 9 seconds, and a decent chunk of that time is chewed up by saving (writing to the disk). I haven't tested it, but we could be talking 5-7 seconds to move said data and make visible.&lt;/p&gt;
&lt;p&gt;I don't know many average end-users that would have a panic attack in that period of time.&lt;/p&gt;
&lt;p&gt;Nice to meet you the other week, Chad, thanks for your time. :)&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nate Oliver&lt;/p&gt;
&lt;p&gt;Microsoft Excel MVP&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9489268</link><pubDate>Thu, 19 Mar 2009 09:59:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9489268</guid><dc:creator>Shasur</dc:creator><description>&lt;p&gt;Thanks for the Nice post:)&lt;/p&gt;
&lt;p&gt;I think 'for each' would also improve the performance&lt;/p&gt;
&lt;p&gt;Dim oWS As Worksheet&lt;/p&gt;
&lt;p&gt;For Each oWS In ActiveWorkbook.Sheets&lt;/p&gt;
&lt;p&gt;instead of &lt;/p&gt;
&lt;p&gt;For i1 = 1 To ActiveWorkbook.Sheets.Count&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Set oWS = ActiveWorkbook.Sheets(i1)&lt;/p&gt;
&lt;p&gt;Next i1&lt;/p&gt;
&lt;p&gt;and also &lt;/p&gt;
&lt;p&gt;For Each oCEll In oWS1.Range(&amp;quot;L3:L100&amp;quot;) etc&lt;/p&gt;
</description></item><item><title>Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9500839</link><pubDate>Mon, 23 Mar 2009 12:41:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9500839</guid><dc:creator>Griselda Taborda</dc:creator><description>&lt;p&gt;Hi there&lt;/p&gt;
&lt;p&gt;the &amp;quot;Read/Write Large Blocks of Cells in a Single Operation&amp;quot; piece of code is magnificent.&lt;/p&gt;
&lt;p&gt;I've been running several loops in my macros, which were taking over 1 minute to run...they now take less than 5 seconds !!!!!&lt;/p&gt;
&lt;p&gt;Wow !!!!!!&lt;/p&gt;
&lt;p&gt;Thanks again for such great piece of work&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9501291</link><pubDate>Mon, 23 Mar 2009 16:40:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9501291</guid><dc:creator>Rick Wargo</dc:creator><description>&lt;p&gt;Beware: even with Calculation set to manual, using multiple combo boxes on different sheets, all pointing to the same LinkedCell will temporarily turn calculation to automatic.&lt;/p&gt;
&lt;p&gt;Actually; I think this may be a bug and would love to see a solution (or workaround). I've posted about it at &lt;a rel="nofollow" target="_new" href="http://www.mrexcel.com/forum/showthread.php?t=378549"&gt;http://www.mrexcel.com/forum/showthread.php?t=378549&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9503240</link><pubDate>Tue, 24 Mar 2009 05:59:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9503240</guid><dc:creator>Nate Oliver</dc:creator><description>&lt;p&gt;&amp;quot;I think 'for each' would also improve the performance&lt;/p&gt;
&lt;p&gt;Dim oWS As Worksheet&lt;/p&gt;
&lt;p&gt;For Each oWS In ActiveWorkbook.Sheets&amp;quot;&lt;/p&gt;
&lt;p&gt;Hi Shasur, have you tested this - in terms of performance? I haven't as it seems like micro-optimization to me.&lt;/p&gt;
&lt;p&gt;But along the same lines, you can iterate through an Array with a For Each syntax against the elements, but it's quite a bit faster to go For i = LBound(Array) to UBound(Array), in my limited testing. In my experience a For Each iteration provides a simpler syntax, but not faster. (in this case, however, retrieving the Count might be a littler slower)&lt;/p&gt;
&lt;p&gt;Also be careful, you're declaring your Variable as a Worksheet and iterating through Sheets - those are two different Collections within the Workbook. A Sheet could be anything, a Worksheet, A Chart Sheet, A Dialog Sheet, an old Macro Sheet...&lt;/p&gt;
&lt;p&gt;If you want to iterate through Worksheets, only, you want something like:&lt;/p&gt;
&lt;p&gt;For each ws in ThisWorkbook.Worksheets&lt;/p&gt;
&lt;p&gt;Versus Sheets.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Nate Oliver&lt;/p&gt;
&lt;p&gt;Microsoft Excel MVP&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9505024</link><pubDate>Tue, 24 Mar 2009 22:07:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9505024</guid><dc:creator>Nate Oliver</dc:creator><description>&lt;p&gt;Quick follow-up, I don't think one can use &amp;quot;For Each is faster&amp;quot; as a rule of thumb. &lt;/p&gt;
&lt;p&gt;As I was saying last night, take the following:&lt;/p&gt;
&lt;p&gt;'--------------------&lt;/p&gt;
&lt;p&gt;Sub foo()&lt;/p&gt;
&lt;p&gt;Dim varEle As Variant, varArr() As Variant&lt;/p&gt;
&lt;p&gt;Let varArr = [{1,2,3}]&lt;/p&gt;
&lt;p&gt;For Each varEle In varArr&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Debug.Print varEle,&lt;/p&gt;
&lt;p&gt;Next&lt;/p&gt;
&lt;p&gt;Debug.Print&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub bar()&lt;/p&gt;
&lt;p&gt;Dim i As Long, varArr() As Variant&lt;/p&gt;
&lt;p&gt;Let varArr = [{1,2,3}]&lt;/p&gt;
&lt;p&gt;For i = LBound(varArr) To UBound(varArr)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Debug.Print varArr(i),&lt;/p&gt;
&lt;p&gt;Next&lt;/p&gt;
&lt;p&gt;Debug.Print&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;'--------------------&lt;/p&gt;
&lt;p&gt;I haven't retimed this, but I'm 99% certain bar() is faster than foo() - while the outcome is the same. However, both are so fast, it's not going to be noticeable.&lt;/p&gt;
&lt;p&gt;So, I'm certainly not saying not to use For Each, it's very readable and a nice use of the OM. But, it seems to me that your biggest optimization gains are going to occur within that iteration, not the iteration itself.&lt;/p&gt;
&lt;p&gt;And a different thought on Chad's code, here:&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;As I mentioned here, in a thread about writing R1C1 functions to a Range in a single go:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.mrexcel.com/forum/showthread.php?t=379262"&gt;http://www.mrexcel.com/forum/showthread.php?t=379262&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The point in temporarily disabling screen redraw is to minimize that process to a single occurrence, at the end of your procedure. &lt;/p&gt;
&lt;p&gt;So, conceptually, the order of operations should be changed, so that ScreenUpdating being reset to True should be done after you've reset the StatusBar and Calculation Mode, i.e.,&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.ScreenUpdating = screenUpdateState&lt;/p&gt;
&lt;p&gt;And using a With Statement will save you some keystrokes. More micro-optimization, but just a thought on order of operations as it's not a major burden to order this in a manner that's conceptually faster (to some extent).&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Nate Oliver&lt;/p&gt;
&lt;p&gt;Microsoft Excel MVP&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9511668</link><pubDate>Thu, 26 Mar 2009 22:02:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511668</guid><dc:creator>Rachmim</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt; purchased EXCEL 2007 I want to know how to use VB with the panel's work EXCEL ie video annotations Books. &lt;/p&gt;
&lt;p&gt;Thank you very much&lt;/p&gt;
&lt;p&gt;Rachmim Ben Artsi&lt;/p&gt;
&lt;p&gt;e-maile yofiel@017.net.il&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9511669</link><pubDate>Thu, 26 Mar 2009 22:02:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511669</guid><dc:creator>Rachmim</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt; purchased EXCEL 2007 I want to know how to use VB with the panel's work EXCEL ie video annotations Books. &lt;/p&gt;
&lt;p&gt;Thank you very much&lt;/p&gt;
&lt;p&gt;Rachmim Ben Artsi&lt;/p&gt;
&lt;p&gt;e-maile yofiel@017.net.il&lt;/p&gt;
</description></item><item><title>re: Excel 2007 VBA Enhancements</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9541456</link><pubDate>Fri, 10 Apr 2009 00:05:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9541456</guid><dc:creator>George Boynton</dc:creator><description>&lt;p&gt;I previously used Excel VBA 2003 for Windows, which had some neat features such as anticipating and auto-typing properties and methods after object names, a Watch Window, and easy-to-use indent and comments tools. &amp;nbsp;Then I purchased a Mac with Excel 2004 for Mac installed on it. &amp;nbsp;The Mac Excel 2004 VBA has none of the nice features of the Windows 2003 VBA I just mentioned, so I am very disappointed.&lt;/p&gt;
&lt;p&gt;Can I regain those features plus other enhancements by buying Excel 2008 for Mac , or must I buy the Excel for Windows 2007 version.&lt;/p&gt;
&lt;p&gt;Thank you. &amp;nbsp; George Boynton&lt;/p&gt;
</description></item><item><title>re: Excel VBA Performance Coding Best Practices</title><link>http://blogs.msdn.com/excel/archive/2009/03/12/excel-vba-performance-coding-best-practices.aspx#9544275</link><pubDate>Sat, 11 Apr 2009 02:40:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9544275</guid><dc:creator>Gavin Shearer</dc:creator><description>&lt;p&gt;George,&lt;/p&gt;
&lt;p&gt;My name is Gavin Shearer, and I'm a Program Manager here in Microsoft’s Macintosh Business Unit. I work on Mac Excel.&lt;/p&gt;
&lt;p&gt;Unlike Excel 2004, Excel 2008 for Mac does not support Visual Basic (VB was removed from Office 2008 for technical reasons).&lt;/p&gt;
&lt;p&gt;As you might imagine, we have heard from some of our customers that VB is critically important to their use of the Office, and we have publicly committed to bring VB back in our next major release of Mac Office (&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/presspass/press/2008/may08/05-13MacBU2008PR.mspx"&gt;http://www.microsoft.com/presspass/press/2008/may08/05-13MacBU2008PR.mspx&lt;/a&gt;). &lt;/p&gt;
&lt;p&gt;To your specific question: if you need VB right now, I would stick with Office 2004 or Office 2007. However, if you can wait a while, I think you’ll be pleased with what we’re delivering in our next release.&lt;/p&gt;
&lt;p&gt;Thanks for your question!&lt;/p&gt;
</description></item></channel></rss>