Hello again. This is easy, I think I just didn't explain it clearly. What is the syntax to make a For 1 To 12 statement skip from 1 to 4 to 8 to 12 instead of 1 - 12 sequentially? I have tried other means, but they are very ineffective and easily messed up by users. Thanks.
For 1 To 12 Statement With Interval
Collapse
X
-
Originally posted by etangmanHello again. This is easy, I think I just didn't explain it clearly. What is the syntax to make a For 1 To 12 statement skip from 1 to 4 to 8 to 12 instead of 1 - 12 sequentially? I have tried other means, but they are very ineffective and easily messed up by users. Thanks.
I suspect you have your numbers a bit mixed up, though. From 1 to 4 is a jump of 3, then the others are jumps of 4. That may be what you want, but it's more likely that you will want all the steps the same size. -
Originally posted by Killer42You need to add a Step clause to the For statement. Check the doco for details.
I suspect you have your numbers a bit mixed up, though. From 1 to 4 is a jump of 3, then the others are jumps of 4. That may be what you want, but it's more likely that you will want all the steps the same size.Comment
-
Originally posted by etangmanThanks a lot, I'll see if I can't figure it out now.
you can use
Code:for i = 1 to 12 step 4 Do some thing..... next i
Comment
Comment