Just to make sure I understand: you have a list of data that changes
from month to month, and the last cell in that list contains an integer
number that represents the number of loops your program requires.
Or did I misunderstand, and instead you need your macro to run until it
encounters the last value in the list, which changes from month to
month.
If it's the first scenario, you can declare an integer variable- I use
K (short for Kounter), and another integer variable, maybe something
like LoopNum. Assign the value in the last cell to LoopNum, and then
start a For loop with this syntax:
For K = 1 to LoopNum
{your code here}
Next K
That's an idea, but it would be helpful to see a sample of your data.
|