View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Saving Excel Pro 2003 iteration results

Also, I believe that the formula you have in C11 could be re-written as:
=CHOOSE(C16,D19,D20,D21,D22,D23,D24)


"Tunja" wrote:

Dear JLatham,

I put the new code. Visial Basic wrote the first calculated value. Then it
did not write any more. Not in the same cell, not in the cell below. There is
only one value written. This may be fixed but I think making the iteration
formulation better may be easier than trying to fix the result part. If we
can fix the iteration part, then I may use your first visial basic
formulation which writes everything.

I added a screenshot of my excel. By this way I may explain what I am doing
better.
http://img40.imageshack.us/img40/808/iterasyon.jpg

I have 5 excel sheets. Index, Calculator (2), (1), (0) and Result. They are
basically selfexplanatory. I am only going to make changes on Index.
Calculator pages calculates (where iteration happens) and Result page will
hold the results.

YELLOW
First I set calculator number from 2 to 0. This determines from which page,
iteration will be taken from. Then I set the formula no from 6 to 1. This
tells the PINK cell from which number of formula, it is going to show.

GREEN
Only takes the iteration results from one of the Calculator Sheets.

What I am doing is first picking calculator page number, let's say 2. Then
setting the angle equal to let's say 40. Then calculating areas for Formula
No 1,2,3,4,5 and 6. So for 1 angle, I calculate 6 different areas (If there
is one). Then I increase the angle, let's say 41 and and recalculate 6 more
different area values.
This goes like this. So in order to make it look clearer, I may try to tell
this like a rope.

calculator2-Formula1-angle40-area1
calculator2-Formula2-angle40-area2
calculator2-Formula3-angle40-area3
calculator2-Formula4-angle40-area4
calculator2-Formula5-angle40-area5
calculator2-Formula6-angle40-area6

so formula changes, area changes.
We are done with angle 40.
Next angle 41.
When angle is 90, this means we are done with calculator2.

Loop may start for calculator1 if it is asked for.
This is the structure of my excel.

During the iteration: calculated area has to be bigger than the minimum area
and DELTA. I could not put 2 iterations in the same cell with IF statement.
Right now iteration starts with DELTA0 condition. Iteration solves the
formula and calculates the area. I check the area; if it is bigger than
minimum area, it's fine otherwise I change the formula and put the formula
related with AAsmin condition. I tried to have an iteration column with
DELTA0 and another column checks this previous column and says =IF("this
cell"Asmin;"this cell";"this cell+1"). This new column do not do the
iteration. So I am changing the formula by hand.

I know I gave so much information and it is kind of confusing.

If I may put 2 iteration formulation in the same cell OR even if I may have
the first iteration formula in one cell and 2nd one next to it and have the
2nd iteration check the 1st iteration, all my problems will be solved. If I
may do this, then I can use your first visial basic code.

I will appreciate if you may share your idea regarding this issue.
Thank you very much.
Regards
Tunja