View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default good gotos and bad gotos

In VBA, Gotos for error handling are largely unavoidable, VBA doesn't have a
good error catch.

As to whether it is good or bad, is it well structured even allowing for
gotos, can you follow it easily, is it well commented, could a different
design remove some. Answer those questions, and you can probably say it is
as best as can be.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"davegb" wrote in message
ups.com...
I've seen here and in my reading that it's best to avoid using gotos in
code. The last program I wrote had quite a few, but after looking back
at them, they were mostly handling user input errors. I tried to cover
every possible user mistake because the macro creates a spreadsheet
used in some pretty backward places.

So my question is, are these kinds of gotos good uses? How do you know
whether it's a "good" goto or a "bad" goto? Any guidelines or
suggestions?

Thanks.