Hi,
I need your help to find any idea how to handle the task.
Let's say - I have the sheet with 500 rows (from the top) where column A contains Name and column B and column C contain some numbers.
row1: name1, 2, 3,
row2: name2, 1, 1,
row3: name3, 3, 1,
row4: name4, 2, 4,
and so on.
I need to sort these rows that way so the total sum of (column B - Column C) * Row() will be the lowest.
In the case above the correct result is:
row1: name3, 3, 1,
row2: name2, 1, 1,
row3: name1, 2, 3,
row4: name4, 2, 4,
The result is:
(3-1)*1+(1-1)*2+(2-3)*3+(2-4)*4 = -9 and will not be lowest in any of other sorting.
How to do it by VBA?
The result can be calculated by formula in the sheet or inside in the macro.
Is it possible to do it so the executing macro will not take whole day??
I need your help to find any idea how to handle the task.
Let's say - I have the sheet with 500 rows (from the top) where column A contains Name and column B and column C contain some numbers.
row1: name1, 2, 3,
row2: name2, 1, 1,
row3: name3, 3, 1,
row4: name4, 2, 4,
and so on.
I need to sort these rows that way so the total sum of (column B - Column C) * Row() will be the lowest.
In the case above the correct result is:
row1: name3, 3, 1,
row2: name2, 1, 1,
row3: name1, 2, 3,
row4: name4, 2, 4,
The result is:
(3-1)*1+(1-1)*2+(2-3)*3+(2-4)*4 = -9 and will not be lowest in any of other sorting.
How to do it by VBA?
The result can be calculated by formula in the sheet or inside in the macro.
Is it possible to do it so the executing macro will not take whole day??