How to jump from a Form procedure to a Workbook or Module procedure?

T

T. Erkson

I have a procedure in a user form and I need to have it execute a procedure in a
worksheet module (same workbook). Basically I need to "Call mySubroutine()"
from a form to an outside subroutine. How do you do that? Even a "GoTo xxx"
would be fine.

I looked at Chip P's site and using his "Programming To The Visual Basic Editor"
(http://www.cpearson.com/excel/vbe.htm) I can programmatically find the
procedure in the correct module and what line it begins on... if it even
matters.

Thanks,

Toby Erkson -- Portland, Oregon -- http://www.bidata.net/
 
S

Susan

just like you did............ only without the parentheses.

code blah blah blah

Call mySubroutine

code blah blah blah

make sure the sub for mySubroutine is a PUBLIC sub.

susan
 
T

T. Erkson

When I Compile the project I get the Microsoft Visual Basic error:
"Compile error:
Sub or Function not defined"

The subroutine being called is not private but is located in Sheet25 of the
Microsoft Excel Objects group. I am NOT using Option Private Module.
Everything is public within the project.

Toby
 
T

T. Erkson

doh.

Thanks Jim, that worked. Never even crossed my mind to try that.

Thank you!
Toby
 

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