Controlling Your VBA Code

Controlling Your VBA Code

In this chapter

  • Creating "smart" procedures that make decisions

  • Handling everything from simple True/False decisions to complex multiple-decision logic

  • Learning about the handy VBA functions that make decisions.

  • Eliminating repetitive coding by making good use of programming loops.

One of the advantages of writing your own VBA procedures instead of simply recording them is that you end up with much more control over what your code does and how it performs its tasks. In particular, you can create procedures that make decisions based on certain conditions and that can perform loops—the running of several statements repeatedly. The statements that handle this kind of processing—control structures—are the subject of this chapter.

     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows