ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   halt a subroutine question (https://www.excelbanter.com/excel-discussion-misc-queries/214760-halt-subroutine-question.html)

teepee[_3_]

halt a subroutine question
 

In the same way that you can start a second sub from within a sub by using
the command

call mymacro

is there a corresponding command to then stop that subroutine?

Should be obvious but I'm struggling with the answer



Gord Dibben

halt a subroutine question
 
The stopping condition would have to be written into the called routine.


Gord Dibben MS Excel MVP

On Sun, 28 Dec 2008 19:03:16 -0000, "teepee" wrote:


In the same way that you can start a second sub from within a sub by using
the command

call mymacro

is there a corresponding command to then stop that subroutine?

Should be obvious but I'm struggling with the answer



Shane Devenshire

halt a subroutine question
 
Hi,

If you are running macroX and you want it to stop based on some condition

If x then Exit Sub

where x is the condition that triggers the macro to stop.

If this helps, please click the Yes button

cheers,
Shane Devenshire

"teepee" wrote in message
...

In the same way that you can start a second sub from within a sub by using
the command

call mymacro

is there a corresponding command to then stop that subroutine?

Should be obvious but I'm struggling with the answer


teepee[_3_]

halt a subroutine question
 
Thanks for the answers. Much appreciated




All times are GMT +1. The time now is 08:51 PM.

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