ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to jump from a Form procedure to a Workbook or Module procedure? (https://www.excelbanter.com/excel-programming/381924-how-jump-form-procedure-workbook-module-procedure.html)

T. Erkson

How to jump from a Form procedure to a Workbook or Module procedure?
 
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/



Susan

How to jump from a Form procedure to a Workbook or Module procedure?
 
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


On Jan 25, 1:46 pm, "T. Erkson" wrote:
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/



Jim Thomlinson

How to jump from a Form procedure to a Workbook or Module procedur
 
Have you tried being more explicit in your reference???

Call Module1.mySubroutine()

--
HTH...

Jim Thomlinson


"T. Erkson" wrote:

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/




T. Erkson

How to jump from a Form procedure to a Workbook or Module procedure?
 
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

"Susan" wrote in message
oups.com...
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


On Jan 25, 1:46 pm, "T. Erkson" wrote:
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/





T. Erkson

How to jump from a Form procedure to a Workbook or Module procedur
 
doh.

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

Thank you!
Toby

"Jim Thomlinson" wrote in message
...
Have you tried being more explicit in your reference???

Call Module1.mySubroutine()

--
HTH...

Jim Thomlinson





All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com