Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Exit All Sub Command?

I have a sub routine called "Main" that calls routine "FindIt". Within
"Findit" I have some I am looking for arouse things. If I don't find it I
want to exit out not just "Findit", but also "Main". Is there an simple way
(one command) to do this besides setting a flag in "Findit" and checking it
in "Main"?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Exit All Sub Command?


You could change FindIt to a function and read the return
value from the function.
The other much less desirable method is to place the single
word "End" in your code when you want to shut everything down.
Be sure to read the help file on the End statement before using it.
'---
Sub Main()
'do stuff
If FindIt() Then Exit Sub
'do more stuff
End Sub
'---
Function FindIt() As Boolean
Dim strWord As String
'do stuff
FindIt = Len(strWord) = 0
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"jutlaux"
wrote in message
I have a sub routine called "Main" that calls routine "FindIt". Within
"Findit" I have some I am looking for arouse things. If I don't find it I
want to exit out not just "Findit", but also "Main". Is there an simple way
(one command) to do this besides setting a flag in "Findit" and checking it
in "Main"?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make Command button ( Save & Exit) for Excel Abutaha Excel Programming 1 November 16th 05 10:39 PM
Intercepting Save and Exit menu command in Excel PeteMann Excel Programming 1 August 4th 05 11:28 PM
How do i create a command button or macro to exit Microsoft Excel raj Excel Worksheet Functions 1 April 30th 05 02:17 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM
On Exit Command Ben[_7_] Excel Programming 4 January 13th 04 11:09 PM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"