If you do Insert=>Module you will get an entry under the modules entry in
the project explorer. Code in these modules are available to all code
within that workbook as long as the module is not declared as private or an
individual procedure is declared as private (this is true whether the
workbook is the personal workbook or not -- there is nothing special about
the personal workbook with respect to this).
Each worksheet has a corresponding module. these modules are used to
support sheet level events that can be selected/declared by using the
dropdowns at the top. This code reacts to actions by the user on that
sheet. Performing the action triggers the event code.
Similar there is a workbook level module. In the project explorer it is
shown as the ThisWorkbook module. It supports code for Workbook level
events.
Unless you are writing event code, you should be working in a general
module.
There is a similar situation with a userform. A module is associated with
the userform like a module is associated with a sheet. In fact, these
associated modules are special predefined Class modules.
You may also create you own classes using class modules.
--
Regards,
Tom Ogilvy
dee said:
Hi Tom,
Thanks for your help! So, I can write code that is stores in the Modules
folder that makes the sub available to all sheets in that workbook only
(unless written in the Modules folder of the Personal folder), OR I can write
code that is specific to only a particular worksheet.
The code is simply stored in the workbook code window; it doesn't have a
container like modules do (being placed in a modules folder)
Are these assumptions correct?
Thanks again!