Microsoft Office Tutorials and References
In Depth Information
Working with Modules
Working with Modules
VBA has several places in which to store code, but the vast majority of code is
stored in Standard modules, regardless of the application. Before a module can
be used, it must first be added to the project. From the VBE Toolbar, select
Insert | Module as shown in Figure 5 . Alternatively, press the down arrow on
the Insert button
and select Module.
Figure 5 – Inserting a Module
The only limitation to the number of modules an Office file can have is the
limitation imposed by the amount of the computer’s memory. Each module can
have one or many procedures. Writing a project using modules to group similar
procedures together helps keep your project better organized.
In this topic, the word “module” is used to indicate a Standard module, though
the word “Standard” is rarely used to describe it; it’s just called a “module”.
Class modules can also be used in VBA Projects; these are referred to as Class
modules in this text.
In our next graphic, the project is expanded to display the contents. Double-
click to hide the contents. Click on the Toggle Folders button to display the
projects as folders, as shown in Figure 6 .
Search JabSto ::

Custom Search