As far as I can see the 1 to N loop is nested within the 1 to NumRows loop.

What makes you think it isn't?

Is the code not doing what you want?

Is it producing incorrect results?