Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Error STOP!!!


Ok, so I searched and I need your help again guys.
How do I stop on Error? just quit, maybe drop a msgbox in there with
reason, but just stop right after it, don't do anything in the code???

Thank you all for your help.

So:
On Error ????
MsgBox "Command Terminated"
....

--
Vikxce
-----------------------------------------------------------------------
Vikxcel's Profile: http://www.excelforum.com/member.php...fo&userid=1860
View this thread: http://www.excelforum.com/showthread.php?threadid=47771

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default On Error STOP!!!

Use Stop

On Error Goto quit_it
'code


quit_it:
Stop

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Vikxcel" wrote in
message ...

Ok, so I searched and I need your help again guys.
How do I stop on Error? just quit, maybe drop a msgbox in there with a
reason, but just stop right after it, don't do anything in the code???

Thank you all for your help.

So:
On Error ????
MsgBox "Command Terminated"
...?


--
Vikxcel
------------------------------------------------------------------------
Vikxcel's Profile:

http://www.excelforum.com/member.php...o&userid=18607
View this thread: http://www.excelforum.com/showthread...hreadid=477714



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default On Error STOP!!!

From VBA help:
End Statement Example
This example uses the End Statement to end code execution if the user enters
an invalid password.

Sub Form_Load
Dim Password, Pword
PassWord = "Swordfish"
Pword = InputBox("Type in your password")
If Pword < PassWord Then
MsgBox "Sorry, incorrect password"
End
End If
End Sub
Stop Statement Suspends execution.SyntaxStopRemarksYou can place Stop
statements anywhere in procedures to suspend execution. Using the Stop
statement is similar to setting a breakpoint in the code.The Stop statement
suspends execution, but unlike End, it doesn't close any files or clear
variables, unless it is in a compiled executable (.exe) file.Mike F

"Bob Phillips" wrote in message
...
Use Stop

On Error Goto quit_it
'code


quit_it:
Stop

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Vikxcel" wrote in
message ...

Ok, so I searched and I need your help again guys.
How do I stop on Error? just quit, maybe drop a msgbox in there with a
reason, but just stop right after it, don't do anything in the code???

Thank you all for your help.

So:
On Error ????
MsgBox "Command Terminated"
...?


--
Vikxcel
------------------------------------------------------------------------
Vikxcel's Profile:

http://www.excelforum.com/member.php...o&userid=18607
View this thread:
http://www.excelforum.com/showthread...hreadid=477714





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
Stop and show error alvin Kuiper Excel Discussion (Misc queries) 2 May 14th 09 12:26 PM
#NAME? - is there a way to stop this error message? m@cr0 Excel Discussion (Misc queries) 3 July 23rd 08 03:17 PM
Stop error message Oggy Excel Discussion (Misc queries) 0 April 15th 07 04:26 PM
Stop Error Message phil Excel Programming 5 January 26th 05 04:29 PM
stop error message phil Excel Programming 4 January 22nd 05 03:27 PM


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

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

About Us

"It's about Microsoft Excel"