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

When handling user input errors you should be able to avoid GoTo
entirely. I've never had to use it for that purpose. The only GoTo
I've ever used is On Error Goto, which deals with errors thrown by VBA.

davegb wrote:
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.