Using Modules
A module contains procedures, data and type declarations, and definitions. Your VBA project does not need to include a module, but there are advantages to doing so. By creating a module, you can include multiple UserForms in your project and you can also run your project as a macro from the Tools menu in progeCAD or by using the VBARUN command.
To insert and use a module
- From the Insert menu in VBA, click Module.
- In the Properties window, type a name for your module. (You can also accept the default name Module1, Module2, etc.)
- Create code in the Code window just as you would for your controls. Module-level code generally contains just the general statements and macro assignments, as shown in the following code:
Public myVariable as Double
Sub anyMacro ()
UserForm1.Show
End Sub