excel - Advance to Next Item from Within a For-Next Loop -
i have for-next loop. within loop test several different criteria , if test fails, ready @ point skip remainder of code in loop , advance "next" item. way handle goto statement takes me line right before "next". i'd prefer not use goto statement, there way advance "next" item within for-next loop? tia!
for x = 1 10 test 1 if test 1 fails goto line1 end if test 2 if test 2 fails goto line1 end if . . . if tests pass add item array end if line1: next
here's workaround lack of continue keyword:
for x = 1 10 test 1 if test 1 fails exit end if test 2 if test 2 fails exit end if . . . if tests pass add item array end if loop while false next
Comments
Post a Comment