And yes, you need a NEXT directly after the first NEXT. You can't have a FOR loop without a NEXT. I recommend printing your loop variables so you can see what your nested loop is doing.