Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Public Sub mySub() Dim a As Integer, b As Integer Dim i As Integer Const step As Integer = 1 a = 1 b = 10 i = a Do While i < b ' actions i = i + step b = b + 5 Loop End Sub On Nov 29, 12:44 pm, Valeria wrote: Dear experts, I need to perform a long loop with many actions on a numer of rows; these actions may result in incrementing the # of rows, and I had used a for - next loop but it does not work, as the end value always stays the same as in the beginning, even if the corresponding variable gets changed during the loop. To give you an example a=1 b=10 For i = a to b 'ACTIONS b=b+5 Next i This does not change b, it will always stay 10, but in my case I need it to get changed... Can somebody please help me? Thanks! Kind regards Valeria |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop with variable name? | Excel Discussion (Misc queries) | |||
For Each ... Next loop - need to reference the loop variable | Excel Programming | |||
Counter variable in For Loop | Excel Programming | |||
Referencing variable in a loop | Excel Programming | |||
Loop with variable | Excel Programming |