Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How come this sub only runs through i=1 and i=2, when k is obviously
updated during loop? Sub Test() k = 2 For i = 1 To k Debug.Print k If k = 2 Then k = 4 Next i End Sub I know this sub solves the problem, but I find Do While loops to be clumsy - any other solutions? Sub test2() k = 2 i = 1 Do While i <= k Debug.Print k If k = 2 Then k = 4 i = i + 1 Loop End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
update range in For loop | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming |