Thread: Do loops
View Single Post
  #2   Report Post  
Bryan Hessey
 
Posts: n/a
Default Do loops


It's pretty uncouth, but a variation of

Dim ctr, ctr1, ctr2, ctr3, ctr4 As Integer
ctr = 1
For ctr1 = 1 To 4
For ctr2 = 5 To 7
For ctr3 = 10 To 13
For ctr4 = 20 To 30
Range("AA" & ctr).Value = " 1 = " & ctr1 & " 2 = " & ctr2 & " 3 = "
& ctr3 & " 4 = " & ctr4
ctr = ctr + 1
Next
Next
Next
Next


should leave a trail in column AA for you, up to 65536 items before an
error


grandfilth Wrote:
Hi,
Is it possible to call show the value of the first, second, third or
forth iteration of a do loop, and continue with the iterations to still
get an end value?This is to give me some idea of what the do loop is
doing...

Also, say my function is called jeff(....) can I change the value of it
according to what cell the function is showing in? For example,

if cell=A2 then
jeff = ....
end if
?

Any help would be great



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=483704