Using functions and subroutines in other modules

R

Robert Crandal

I have some functions and subroutines define in Module1.
How would I go about using/calling these functions
from Module 2???

(sorry if that is a newb question)
 
S

Simon Lloyd

Use the CALL function like this

Code
-------------------
Sub One(
Msgbox "This is One, Next is Two",vbokonly,"Sub One
Call Tw
End Su

Sub Two(
Msgbox "This is Two, Next is Three",vbokonly,"Sub Two
Call Thre
End Su

Sub Three(
Msgbox "This is Three, Next is Four",vbokonly,"Sub Three
Call Four
End Su

Sub Four(
Msgbox "This is Four, End of messages!",vbokonly,"Sub Four"
End Su
-------------------
I have some functions and subroutines define in Module1
How would I go about using/calling these function
from Module 2??

(sorry if that is a newb question

--
Simon Lloy

Regards
Simon Lloy
'Microsoft Office Help' (http://www.thecodecage.com
 
D

Dan

In Module2 simply call the Functions and Procedures as you would in Module1
but its often best to qualify you calls...

Module1.Procedure1(x)

x = Module1.Function1(x)

etc, etc ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top