#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default on error

when looping through my code...if i receive an error...when the error occurs
how can i have it go back to the top of the block of code...so in other words

for example

Start back here

code
code
code
on error go back to "Start back here"
code
code
code

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default on error

for example

:ThisPlace

code
code
code
on error goto ThisPlace
code
code
code



Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default on error

Hi Corey, I believe the Label should have the colon after instead of before

ThisPlace:

"Corey ...." wrote:

for example

:ThisPlace

code
code
code
on error goto ThisPlace
code
code
code



Corey....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default on error

Avoid using GoTo whenever possible.

Rick Rothstein sums up very nicely the reasons not to use Goto and offers
alternatives:
http://groups.google.com/group/micro...21f2381df1a2dd

Just to add, the opposite of GoTo is the COMEFROM statement (this is funny).
http://en.wikipedia.org/wiki/Comefrom



--
Tim Zych
http://www.higherdata.com
Compare data in Excel and find differences with Workbook Compare
Free and Pro versions available



"dstiefe" wrote in message
...
when looping through my code...if i receive an error...when the error
occurs
how can i have it go back to the top of the block of code...so in other
words

for example

Start back here

code
code
code
on error go back to "Start back here"
code
code
code



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
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 [email protected] Excel Programming 7 August 7th 08 08:43 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 07:04 AM.

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"