Using The Visual Basic Editor

You can easily change the name of a module within the Visual Basic Editor. When you create a new module, the Visual Basic Editor automatically names the module Module# with the number sequentially following the last module you created. For example: Module1, Module2, etc.. If you have a project with several different modules, it becomes difficult to distinguish one module from another without reviewing the source code. You can name modules so they are easier to distinguish. You do so by assigning the name of the main subroutine of function in the module as the module name. This allows you to quickly determine which module contains the desired macro. The name of the macro changes on the Properties window. To change the name, simply change the value in the Name field on the Properties window for the module that you have selected in the Project Explorer. As soon as you press Enter, the name of the module changes on the corresponding node on the Project Explorer window.

! File Edit View Insert Format Debug Run Lools Add-Ins Window Help

- U | X HI B (¡4 | 1 r> . II ■ M X&yt if [J) | Ln 2, Col 1

! File Edit View Insert Format Debug Run Lools Add-Ins Window Help

- U | X HI B (¡4 | 1 r> . II ■ M X&yt if [J) | Ln 2, Col 1

File Edit View Insert Formet lools Dote Window Help Type a question for help

L0 ype Sub NewSubroutine replacing NewSubroutine with the name of the new subroutine.

Note: See Chapter 3 for information on creating subroutines.

Was this article helpful?

0 0

Post a comment