View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
uno@korsmaa uno@korsmaa is offline
external usenet poster
 
Posts: 9
Default For To Next loop

Dear professionals

Does the For ...To .. Next loop have a syntax where I could run 2
different number ranges in the same loop (will illustrate my question by a
fake "code").

For n = 1 To 10 And For n = 21 To 30
... do something
Next n

I guess I could inside the loop, use an IF condition at the beginning and
let the loop ignore part of the numbers, but maybe there is a direct way
also.

-----------------------------------
All the best, and thanks in advance.
Uno Kõrsmaa