ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   End Sub, End complete procedure (https://www.excelbanter.com/excel-programming/362837-end-sub-end-complete-procedure.html)

BEEJAY

End Sub, End complete procedure
 
Have stumbled on the fact that I can use "end sub" (with message box) if that
process is not to continue.
I have other message boxes that are to exit the complete procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end of the
routine?

ADG

End Sub, End complete procedure
 
Hi Beejay

Try using a public variable set at module level of type Boolean which gets
set if you should exit all routines. Be careful to set the default values
when you app opens / changes


--
Tony Green


"BEEJAY" wrote:

Have stumbled on the fact that I can use "end sub" (with message box) if that
process is not to continue.
I have other message boxes that are to exit the complete procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end of the
routine?


BEEJAY

End Sub, End complete procedure
 
Sorry, this is greek to me.
Are you indicating a "public" call routine which has code to exit the process?
What default values are you referring to?


"ADG" wrote:

Hi Beejay

Try using a public variable set at module level of type Boolean which gets
set if you should exit all routines. Be careful to set the default values
when you app opens / changes


--
Tony Green


"BEEJAY" wrote:

Have stumbled on the fact that I can use "end sub" (with message box) if that
process is not to continue.
I have other message boxes that are to exit the complete procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end of the
routine?


Ardus Petus

End Sub, End complete procedure
 
You can use End instruction
(Just End; not End Sub or End Function)
That will exit all code.

HTH
--
AP

"BEEJAY" a écrit dans le message de news:
...
Have stumbled on the fact that I can use "end sub" (with message box) if
that
process is not to continue.
I have other message boxes that are to exit the complete procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end of the
routine?




Chip Pearson

End Sub, End complete procedure
 
The Exit Sub statement will exit the current procedure and return
to the called procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"BEEJAY" wrote in message
...
Have stumbled on the fact that I can use "end sub" (with
message box) if that
process is not to continue.
I have other message boxes that are to exit the complete
procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end
of the
routine?




BEEJAY

End Sub, End complete procedure
 
Greetings All:
"end" does the trick
"Exit Sub" - Good to know.
Thank-you


"Chip Pearson" wrote:

The Exit Sub statement will exit the current procedure and return
to the called procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"BEEJAY" wrote in message
...
Have stumbled on the fact that I can use "end sub" (with
message box) if that
process is not to continue.
I have other message boxes that are to exit the complete
procedure, which
consists of 12+ "call" routines.
How do I "cancel" the balance of the routine OR jump to the end
of the
routine?






All times are GMT +1. The time now is 10:05 AM.

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