Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
For i=1 to 5 if .... then .... .... GO TO THE BEGINNING OF FOR NEXT LOOP end if .... .... next i What should I say to mean "GO TO THE BEGINNING OF FOR NEXT LOOP" above (if I can). Thanks and regards, Cousin Excel |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
In the If statement you can test for a condition then if satisfied exit the for next loop For i = 1 To 5 if my condition is met then Exit For End If Next i -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "CousinExcel" wrote: Hi, For i=1 to 5 if .... then .... .... GO TO THE BEGINNING OF FOR NEXT LOOP end if .... .... next i What should I say to mean "GO TO THE BEGINNING OF FOR NEXT LOOP" above (if I can). Thanks and regards, Cousin Excel |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub demo()
For i = 1 To 5 v = Cells(i, 1).Value If v 10 Then Cells(i, 2).Value = "Big" GoTo skiput End If Cells(i, 2).Value = "Little" skiput: Next i End Sub -- Gary''s Student - gsnu201003 "CousinExcel" wrote: Hi, For i=1 to 5 if .... then .... .... GO TO THE BEGINNING OF FOR NEXT LOOP end if .... .... next i What should I say to mean "GO TO THE BEGINNING OF FOR NEXT LOOP" above (if I can). Thanks and regards, Cousin Excel |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Many thanks.
CousinExcel "Gary''s Student" wrote: Sub demo() For i = 1 To 5 v = Cells(i, 1).Value If v 10 Then Cells(i, 2).Value = "Big" GoTo skiput End If Cells(i, 2).Value = "Little" skiput: Next i End Sub -- Gary''s Student - gsnu201003 "CousinExcel" wrote: Hi, For i=1 to 5 if .... then .... .... GO TO THE BEGINNING OF FOR NEXT LOOP end if .... .... next i What should I say to mean "GO TO THE BEGINNING OF FOR NEXT LOOP" above (if I can). Thanks and regards, Cousin Excel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Exit Sub | Excel Discussion (Misc queries) | |||
Run when exit | Excel Worksheet Functions | |||
on exit macro | Excel Discussion (Misc queries) | |||
exit excel | Excel Discussion (Misc queries) |