Do until row is no more than 6 times row below

bmaule

New Member
Joined
Aug 17, 2009
Messages
24
Hi all,

I have 14 columns of number each having 20 rows. I would like to "normalize" the data so that no row has a value that is more than 6 times the row below.
I have use "do until" and "do while" macros but cannot get them to do what I want which is to keep changing the values until the condition is satisfied.

For example: if row1 =120; row2=90; row3=10; row4=1. The result should should be 120, 36, 6, 1. In others words the macro should change the same value several times until the condition is satisfied.
 
Hi PCL no need to be sorry and I am grateful for your efforts to help me. So what was happening is that your macro was generating and error at the condition statement ("IF). However by inserting "on error resume next" it now runs without a hitch. The problem now is that it seems to be only "looping" once and once it has made a change it does not check to see how that change has affected the other rows and if it has then update the change previously made. Your macro results in 38.88, 6.48; 1.08; 0.18. So while it has made changes, it should look at those changes and make additional changes consistent with the conditions set. So after the first set of changes it would then change 1.08 to 0.94 and then change the others.
Thanks.
 
Last edited:
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I have no idea why occued an error ...what is the data when it happens???

it seems to be only "looping" once and once it has made a change
NO , NO, NO the code starts from the bottom of the column and do the test with the cell above, then modify the cell above if needed then redo the test until row FR
Have you run the code with next data in the cells as mentioned: Only one column : A

A5 = 5242.84
A6 = 2.52
A7 =0.04
A8= 0.018

and of course put the code in a module ...!
 
Upvote 0
I forgot to ask you : There is only one macro, the one sent ... no other one in the tab' code for example ??
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top