Call another Sub Routine

csprop

Registered User.
Local time
Yesterday, 23:52
Joined
Jul 27, 2004
Messages
12
Right now I have a lot of redundant code in three or four different subs. I've tried to create another sub with that code in it, and the new sub in the others to avoid having to write the same code in multiple subs.

How can I tell VB to run the sub contaning the common code from the other subs?

Thanks.
 
csprop,

Try creating a Public Function or Sub in it's own module and call it from a Private Sub using:

CALL My_Function
or
My_Function
or
=My_Function()

Do a help search for Public vs. Private

Good luck.
 
You were correct. I was using a Private sub instead of a Public sub. Nine out of ten problems I come across are caused by mundane details which I should have known better.

Thanks for the wake up call!
 

Users who are viewing this thread

Back
Top Bottom