If I recall correctly, there was a bug some time back that caused loop structures to fail when a subroutine was called .

To test this comment out the 'Gosub "Sub_Network"' and see if the loop displays all the values you expect.

If it does, just convert the subroutine to a UDF.