Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Exactly! cheers, Shane Devenshire "dhstein" wrote: Thanks Shane. So if I understand you, then "Module1" in Workbook A is completely separate from "Module1" in Workbook B ? "ShaneDevenshire" wrote: Hi, 1. Everytime you close your workbook and then reopen and record a new macro, Excel begins a new Module. If you record your modules all during one session (while the workbook stays open) Excel records all the code into the same module. But again, not so if you close the file and reopen and begin a new recording. 2. Excel uniquely names each module just like sheets in a workbook. 3. You can delete any module by right clicking it and choose Remove.... 4. You can copy code from one module to another even in another workbook 5. You can, and should, rename your modules. You can do that if the Properties window is displayed and you are on a module in the Projects window. The first property is Name (no spaces allowed in names) 6. You can refer to a module in code if necessary, for example if you have two workbooks open and you want to execute the code in a module with the same name as one in the active workbook, but in the other workbook. But this is getting a little far into the VBA area. -- Thanks, Shane Devenshire "dhstein" wrote: I'm trying to understand the Naming/Use of Modules in VB. I have several Excel workbooks with VB macros that I've either developed or copied from the web. At the moment, I have only one workbook open and I see in the VB Project window that I have 9 modules - some of which are completely empty. Does Excel keep track of modules and name each one uniquely? What happens if I copy the code from module 9 into module 1 and another workbook has module 1 defined? Any help would be appreciated. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with modules. | New Users to Excel | |||
Protected modules | Excel Discussion (Misc queries) | |||
Empty modules | Excel Discussion (Misc queries) | |||
Deleting blank modules | Excel Discussion (Misc queries) |