Chapter 17. Optimizing VBA Performance

A common complaint about VBA in general, and particularly procedures that automate Excel, is poor performance. While there is some truth in that, say when compared to C++, it is often due to poorly structured or poorly written code. This is probably because VBA makes it easy to write code that works, but difficult to write code that works fast. As a general rule, the speed of a well-optimized procedure can often be an order of magnitude faster than the original code, and improvements of two orders of magnitude are not uncommon. This chapter explains how to achieve those savings.

Measuring Performance

The end users of your application are the final arbiters of performance, and they rarely use stopwatches to ...

Get Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA, and .NET, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.