Microsoft Office Tutorials and References
In Depth Information Module-level variables
One of the advantages of local variables is that we can use the same name in different procedures
without conflict, since each variable is visible only to its own procedure. Module-level variables
A module-level variable (or constant) is one that is declared in the declarations section of a code
module (standard, class, or UserForm). Module-level variables and constants come in two flavors:
private and public.
Simply put, a module-level public variable (or constant) is available to all procedures in all of the
modules in the project, not just the module in which it is declared, whereas a module-level private
variable (or constant) is available only to the procedures in the module in which it was declared.
Public variables and constants are declared using the Public keyword, as in:
Public APubInt As Integer
Public Const APubConst = 7
Search JabSto ::

Custom Search