Do loops

G

grandfilth

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

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

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

Any help would be grea
 
B

Bryan Hessey

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
 
Top