ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Visual Basic (https://www.excelbanter.com/excel-programming/276660-visual-basic.html)

Todd[_7_]

Visual Basic
 
Hello,

How do you execute an outside sub procedure from an
existing sub procedure? i.e. If value = 5 Then run
sub "1", ElseIf value = 4 Then run sub "2".

Thanks for your help,
Todd

steve

Visual Basic
 
Todd,

If value = 5 Then
Call sub1 ....

I have seen
Run sub1

My favorite is
Module1.Macro1
this identifies the module and the macro for easier trouble shooting.

It gets a little trickier if the sub is in another workbook, but it can be
done.

--
sb
"Todd" wrote in message
...
Hello,

How do you execute an outside sub procedure from an
existing sub procedure? i.e. If value = 5 Then run
sub "1", ElseIf value = 4 Then run sub "2".

Thanks for your help,
Todd




Todd[_7_]

Visual Basic
 
Steve,

Thank you very much. It worked!

Todd


-----Original Message-----
Todd,

If value = 5 Then
Call sub1 ....

I have seen
Run sub1

My favorite is
Module1.Macro1
this identifies the module and the macro for easier

trouble shooting.

It gets a little trickier if the sub is in another

workbook, but it can be
done.

--
sb
"Todd" wrote in message
...
Hello,

How do you execute an outside sub procedure from an
existing sub procedure? i.e. If value = 5 Then run
sub "1", ElseIf value = 4 Then run sub "2".

Thanks for your help,
Todd



.


steve

Visual Basic
 
Todd,

Glad to be of help!

Keep on Exceling...

--
sb
"Todd" wrote in message
...
Steve,

Thank you very much. It worked!

Todd


-----Original Message-----
Todd,

If value = 5 Then
Call sub1 ....

I have seen
Run sub1

My favorite is
Module1.Macro1
this identifies the module and the macro for easier

trouble shooting.

It gets a little trickier if the sub is in another

workbook, but it can be
done.

--
sb
"Todd" wrote in message
...
Hello,

How do you execute an outside sub procedure from an
existing sub procedure? i.e. If value = 5 Then run
sub "1", ElseIf value = 4 Then run sub "2".

Thanks for your help,
Todd



.





All times are GMT +1. The time now is 07:32 AM.

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