Chapter 17. Optimizing VBA Performance A common complaint about VBA in general, and particularly routines that automate Excel, is poor performance. Although there is some truth in that, say when compared to C++, it is very often due to poorly structured or poorly written code. This is probably because VBA makes it very easy to write code that works, but quite difficult to write code that works fast. As a general rule, the speed of a well-optimized routine 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. |