Team LiB
Previous Section Next Section

Starting a New Procedure in the VBA Editor

One of the handiest features of the VBA Editor is the ability to start a new procedure using a dialog box. Up to this point, you have started procedures by typing the keyword Sub followed by the name of the procedure, as follows:

Sub addNumbers() End
Sub

The VBA Editor adds the End Sub line automatically, as well as the opening and closing parentheses after the procedure name.

There is another way of doing this: by selecting Insert | Procedure. You should see the following dialog box:

Here you can add the name of the procedure, the type of procedure, and the scope of the variables. If you don’t know what that last part is, don’t worry! You will find out in the next chapter.


Team LiB
Previous Section Next Section