LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default goto statement in VBA

It's not about the number of lines following the label. In general GoTo
statements are not recommended at all, except for

On Error GoTo ...

to handle error trapping. GoTo statements are throwbacks from the '40s
(Fortran). They tend to make code less readable than using If-Then-Else or
calling subroutines and functions, but once in a while they can be used.

In all of my libraries I have only one old function I can think of where I
used GoTo's not in error trapping. It is a Heap Sort that proved to run
faster with GoTo's than two other versions where the GoTo's were replaced
with more structured code.

Other than that, GoTo's are Gone.

"Laurie" wrote:

Thanks for all your quick responses and very helpful suggestions!!!!!!

I need time to digest the ideas but I can see some way to solve the problem
now.

So, goto statement is universally not recommended if multiple statements
need to be put under the label line?

Thanks,
Laurie



 
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
? IF and GOTO ? Karen D Excel Worksheet Functions 2 September 1st 09 07:57 PM
Goto alvin Kuiper Excel Programming 5 August 6th 07 12:46 PM
Goto statement in an IF function =\ Excel Worksheet Functions 2 August 11th 05 06:21 PM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM


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