Outputting numbers 1 to 100 in rows of 10

Closed
d_s - Oct 13, 2009 at 06:48 AM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Oct 14, 2009 at 01:32 AM
Hello,

Could someone give me help with Excel: how to output the numbers 1 to 100 (10 rows with 10 columns) using a For loop. so far i have the following

For x = 1 To 10
Cells(1, x) = x
Next x

For x = 1 To 10
Cells(2, x) = x + 10
Next x

etc....

This works but I would like to make the code as short as possible. As you can guess I'm a beginner to using Excel so any help would be much appreciated.
Related:

1 response

Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 307
Oct 14, 2009 at 01:32 AM
'Hello
'Try this
for i=1 to 100
for j=1 to 100
cells(i,j)=i*j
next j
next i



6