View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Graham Whitehead Graham Whitehead is offline
external usenet poster
 
Posts: 72
Default Help with "double" loop!

Cant really see anything wrong with your logic here. Try this example:

Sub loops()

Dim x As Integer
Dim y As Integer

For x = 1 To 10
For y = 1 To 10
Cells(x, y).Value = x & ", " & y
Next y
Next x

End Sub

"erikhs" wrote in
message ...

Hi,

I would like to make a loop that fills a cell with a formula
vertically(column index), and then when it reaches the max boundary for
i(Last specified cell in i) it should 'jump' down a row and begin at the
same column as before. This should be repeated until j(or row index) is
max.
I was thinking something like:

For j = 1 to x
.........
For i = 1 to y
...................
Next i
..........
Next j

However i can't get this to work. Any help will be really appreciated.


--
erikhs
------------------------------------------------------------------------
erikhs's Profile:
http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=565095