Debugging VBA Procedures
In this chapter
It's usually easy to get short Sub and Function procedures up and running. However, as your code grows larger and more complex, errors inevitably creep in. Many of these errors—programmers call them bugs—will be simple syntax problems you can fix easily, but others will be more subtle and harder to find. For the latter—whether the errors are incorrect values being returned by functions or problems with the overall logic of a procedure—you'll need to be able to look "inside" your code to scope out what's wrong. The good news is that VBA gives you several reasonably sophisticated debugging tools that can remove some of the burden of program problem solving. This chapter looks at these tools and shows you how to use them to help recover from most programming errors.