Saving data from iterations of circular references

  • Thread starter Thread starter Michaelhahn
  • Start date Start date
M

Michaelhahn

Hi all,

I have a circular reference that I can iterate to generate a whol
bunch of data. What I would like to do is to save the data from eac
iteration so that I can plot it on a chart. Is this possible? I don
seem to be able to do it? Has someone done this previously, if so how
Is there a macro I can use to do this?

Any help would be greatly appreciated.

Cheers

Michae
 
Perhaps something like this:-

Assuming the range you want to chart is the cell C9, and you want to put that
data in Col A. Enter the data in the cell containing your variable and then run
the routine.

Sub Iterations()

Application.Calculation = xlCalculationManual
z = 1
Cells(z, "A").Value = Range("C9").Value 'The cell you want to chart
z = z + 1

Do
Application.Calculate
x = Range("C9").Value 'The cell you want to chart
Cells(z, "A").Value = x
z = z + 1
Application.Calculate
y = Range("C9").Value 'The cell you want to chart
Cells(z, "A").Value = y
z = z + 1
Loop Until y = x

Application.Calculation = xlCalculationAutomatic

End Sub

Just format the cells to as many decimals as you need subject to limits.
 
Thanks heaps for that macro Ken Wright .
I have run it and it works.
However it loops forever. Can I set it up so that it could save dat
from a certain number of iterations?

Thanks again Michae
 
Micheal,

Maybe Ken's off for the weekend. The newsgroups seem to be slow. I'll jump
in here with a suggestion. Try Loop Until z = 21 (for 20 iterations).
Etc.
 
Back
Top