Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Exit a macro from an error condition

Is there a way to exit a program during it's execution. I want to
check if a condition is met...if not, then exit the program.
thanks
chuckm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Exit a macro from an error condition

Chuck,


You can use the Exit Sub statement to exit the current procedure.
E.g.,

If whatever = False Then
Exit Sub
End If



"ChuckM" wrote in message
...
Is there a way to exit a program during it's execution. I

want to
check if a condition is met...if not, then exit the program.
thanks
chuckm



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Exit a macro from an error condition

Chuck,

Sure can....
What condition are you checking for??

If range("A1") = "abc" Then Exit Sub

John

"ChuckM" wrote in message
...
Is there a way to exit a program during it's execution. I want to
check if a condition is met...if not, then exit the program.
thanks
chuckm



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
Run macro on exit Steve Excel Discussion (Misc queries) 12 October 25th 09 01:43 PM
Excel 2007 Exit Error [email protected] Excel Discussion (Misc queries) 1 January 12th 07 01:32 PM
Make Exec work properly (error messages on start and exit) TorG 8-(( Excel Discussion (Misc queries) 9 April 18th 06 01:10 PM
Exit via macro only? Brisbane Rob Excel Discussion (Misc queries) 1 October 13th 05 01:16 PM
on exit macro ditchy Excel Discussion (Misc queries) 2 May 3rd 05 12:11 AM


All times are GMT +1. The time now is 11:35 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"