View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default Jumping out of loop with GoTo function

If value = 1 Then 'Forgot the "Then"
GoTo Line1 'No colon needed here

HTH

Charles

Andy wrote:
Hi people!

I would like to jump out of a Do loop using the goto statement e.g.

Do Until condition

While i= 0 And i < value

if value = 1

GoTo Line1:

End If

Wend

Loop

Line1:

Obviously this doesn't do anything, but is the structure correct and
the code correct for the statements shown? Do I need to declare Dim
Line1 as String. My program doesn't work and I think GoTo has something
to do with it not working. I do not have the help file either.

Thank you