ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA - Need macro to find optimal placement of rows in pairs (https://www.excelbanter.com/excel-discussion-misc-queries/213136-vba-need-macro-find-optimal-placement-rows-pairs.html)

Kasper

VBA - Need macro to find optimal placement of rows in pairs
 
Hi

I could use some help in programming a macro that calculates the
optimal placement of elements.
I have 50 rows with data. Coloumn B has numbers ranging from
1500-8600. I need a macro that can lookup the coloum with the highest
number and find another row with the highest number which when added
can be no higher than 8600 and copy these two coloumn to another
placement.


Eg.

7.500 mm
7.000 mm
6.800 mm
6.000 mm
5.400 mm
5.400 mm
5.200 mm
3.600 mm
3.600 mm
3.500 mm
2.500 mm
2.400 mm
1.000 mm

It should now take the coloumn with 7.500 mm and see that combined
with the coloumn with 1.000 mm it gives no more than 8600 mm and copy/
cut these two out of the table and then control the next coloumn(7.000
mm) and find if anything goes with together with this still under 8600
mm but as close to ass possible.

Does this make any sense? Hope I haven't confused you too much.
Any help, advise etc. will be welcome...


Greetings Kasper

Kasper

VBA - Need macro to find optimal placement of rows in pairs
 
On 10 Dec., 15:47, Kasper wrote:
Hi

I could use some help in programming a macro that calculates the
optimal placement of elements.
I have 50 rows with data. Coloumn B has numbers ranging from
1500-8600. I need a macro that can lookup the coloum with the highest
number and find another row with the highest number which when added
can be no higher than 8600 and copy these two coloumn to another
placement.

Eg.

7.500 mm
7.000 mm
6.800 mm
6.000 mm
5.400 mm
5.400 mm
5.200 mm
3.600 mm
3.600 mm
3.500 mm
2.500 mm
2.400 mm
1.000 mm

It should now take the coloumn with 7.500 mm and see that combined
with the coloumn with 1.000 mm it gives no more than 8600 mm and copy/
cut these two out of the table and then control the next coloumn(7.000
mm) and find if anything goes with together with this still under 8600
mm but as close to ass possible.

Does this make any sense? Hope I haven't confused you too much.
Any help, advise etc. will be welcome...

Greetings Kasper


No ideas?


All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com