Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Yet another question... This time about the VBA Editor

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Yet another question... This time about the VBA Editor

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Yet another question... This time about the VBA Editor

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Editor - Time and Date Entry Continued Tammy Excel Worksheet Functions 2 January 4th 08 03:49 PM
Query Editor question R_CAxcelis Excel Discussion (Misc queries) 0 November 20th 07 09:17 PM
General question about using "worksheet" when select from the VBA Editor? Susan Hayes Excel Programming 6 December 14th 04 12:45 PM
Create combo box in Excel using VB editor during run time Alvin[_2_] Excel Programming 1 June 20th 04 03:28 PM
time question Cesar Zapata[_2_] Excel Programming 2 February 27th 04 05:20 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"