Do you know how to do a loop?
Loop round the amount of 'rows' and within each loop put another loop for the amount of columns.
for example...
for x = 0 to 10
for y= 0 to 10
next
next
if you were to output the values, you would get... x=0 , y=0,1,2,3,4,5,6,7,8,9,10 then x=1 ...