ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use same On Error twice (https://www.excelbanter.com/excel-programming/336741-use-same-error-twice.html)

jamnham

Use same On Error twice
 

How can I use the same 'On Error' twice?

example

Start:
On Error Goto Handle
'code is here
Goto EndMe
Handle:
MsgBox"Here is Error"
Goto Start
EndMe:

The 'On Error' works the first time, but first time only. Help?


--
jamnham
------------------------------------------------------------------------
jamnham's Profile: http://www.excelforum.com/member.php...o&userid=26072
View this thread: http://www.excelforum.com/showthread...hreadid=394096


Earl Kiosterud

Use same On Error twice
 
Jamnhan,

There's only one error object, Err. You can examine Err.Number,
Err.Description, etc., in your error handler. It's reset by Resume Next at
the end of your error handler. If another error occurs before it's reset,
it causes vba to issue an error message, something like "Aaaaauugh! I can't
handle all these errors!"
--
Earl Kiosterud
www.smokeylake.com

"jamnham" wrote in
message ...

How can I use the same 'On Error' twice?

example

Start:
On Error Goto Handle
'code is here
Goto EndMe
Handle:
MsgBox"Here is Error"
Goto Start
EndMe:

The 'On Error' works the first time, but first time only. Help?


--
jamnham
------------------------------------------------------------------------
jamnham's Profile:
http://www.excelforum.com/member.php...o&userid=26072
View this thread: http://www.excelforum.com/showthread...hreadid=394096





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

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