ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   on error (https://www.excelbanter.com/excel-programming/423219-error.html)

dstiefe

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


Corey ....

on error
 
for example

:ThisPlace

code
code
code
on error goto ThisPlace
code
code
code



Corey....



JLGWhiz

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....




Tim Zych

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





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

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