Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I attempt to create new macros at least in between sessions in working
on my spreadsheets, it appears that the VB Editor puts the code into new basic modules. I have modules 1 through 4 right now, but I don't seem to be able to see them all simultaneously and there are functions I developed in one module that I really want to use in another module. I can see them in the object browser, but I can't seem to combine them..... I don't want to have them all in the same physical file if I can help it. Also I am trying to locate the actual physical file in which they are stored. They don't seem to be stored as a .BAS file. Can someone explain how they are being stored and what I need to do to reference one module function inside of another module? -- Henry Stock, Network Administrator onProject.com 3 Wing Drive Cedar Knolls, NJ 07927-1006 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want to call another procedure (from module to another) you just
use: Call ______ and fill in the blank with the name of the procedure. Also it is relatively easy to save the modules as text files. Just change the extension to .txt when you export it. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Henry
Henry Stock wrote: When I attempt to create new macros at least in between sessions in working on my spreadsheets, it appears that the VB Editor puts the code into new basic modules. I have modules 1 through 4 right now, but I don't seem to be able to see them all simultaneously and there are functions I developed in one module that I really want to use in another module. I can see them in the object browser, but I can't seem to combine them..... I don't want to have them all in the same physical file if I can help it. You can call subs and functions in other modules as easy as if they were in the same module, unless you've used the Private keyword - then they're only available in that module. Code modules are not files separate from the workbook. All the code is stored in the .xls file and modules are only there to help you organize your code. If you really want your code to be in different physical files, then you need multiple xls files. To combine code from different modules, cut the code (Cntl+x) from one module and paste it (Cntl+v) to the other. Then "Remove" the empty modules. Also I am trying to locate the actual physical file in which they are stored. They don't seem to be stored as a .BAS file. There is no physical file for VBA code, it resides in the host document (xls file for Excel VBA). You can export a code module to a bas file, but you would only do that to back it up, clean it, or transfer it to another workbook. The exported file has no relationship to the xls where it came from. Can someone explain how they are being stored and what I need to do to reference one module function inside of another module? -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Editor - Time and Date Entry Continued | Excel Worksheet Functions | |||
Query Editor question | Excel Discussion (Misc queries) | |||
General question about using "worksheet" when select from the VBA Editor? | Excel Programming | |||
Create combo box in Excel using VB editor during run time | Excel Programming | |||
time question | Excel Programming |