Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have the following bit of code in my macro.
For colCnt = 2 To lstCol (lines of code here) Next colCnt Within the For loop certain conditions require changing the value of lstCol (say it was 5 initially and it becomes 6). Is there a way to ensure that loop executes till colCnt = 6 (inclusive). I tried setting lstCol = 6 but the loop excutes only uptil 5. Thanks for your help. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"for"get FOR. Use While:
Sub loopy() topp = 5 i = 1 While i < topp MsgBox (i) topp = 8 i = i + 1 Wend End Sub -- Gary''s Student - gsnu200843 "Farooq Sheri" wrote: I have the following bit of code in my macro. For colCnt = 2 To lstCol (lines of code here) Next colCnt Within the For loop certain conditions require changing the value of lstCol (say it was 5 initially and it becomes 6). Is there a way to ensure that loop executes till colCnt = 6 (inclusive). I tried setting lstCol = 6 but the loop excutes only uptil 5. Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop through last cell/row of used range | Excel Discussion (Misc queries) | |||
Is it possible to reset the starting cell in a For Loop | Excel Discussion (Misc queries) | |||
Loop QUESTION to end of data range... | Excel Worksheet Functions | |||
Loop QUESTION to end of data range... | Excel Worksheet Functions | |||
x y scatter chart series ranges reset to x(range) = y(range) | Charts and Charting in Excel |