Secrets of the Office Masters: Getting Ready to Tackle VBA

Ready to start working with VBA? Good. Take a few moments to organize your screen and customize the VBA Editor. That way, you won't have to hunt and click so much to get going. (To start the VBA Editor, just start your favorite Office application and press Alt+F11.)

Most VBA aces believe that the best way to arrange VBA and any Office application is by putting the application in the top half of the screen and the VBA Editor in the bottom half, as you can see in this figure. That way, you can step through your program, keeping track of the active command in the bottom window, while watching the effects of your program in the top window.

As you become more proficient, you might want to add VBA's Immediate Window (choose View, Immediate Window) so that you can change variable values as the program runs and test unfamiliar VBA commands. You might also want to get rid of the Properties window (in the lower-left corner; View, Properties Window) if you won't be working with custom-built dialog boxes.

Remember, the behavior of the VBA Editor is controlled by choosing Tools, Options and clicking the Editor tab. In particular, consider checking the Require Variable Declaration box. That will protect you from the single most common source of programming errors—misspellings.


Figure 38.11.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.12.34