# Identify set of values which total is given value - vba

#### Darshan Shah

##### New Member
Hello All,

As I am a new learner, stuck in a position with a large data bank.

I have a worksheet. In column A, Packet numbers are there (For example, Packet-1, Packet-2,......Packet-n).
In column B, weight of packets (For example, 1000 kg, 2000 kg, ..... ).
Permissible weight per vehicle is give as Minimum & Maximum kg which is variable.

I need to write a macro which will give output as a combination of packets with weight for each vehicle.

For example,

Total weight of Packet-1 , Packet-3, packet-4, Packet-10 & Packet-12 will be within a limit of Vehicle-X.

Total weight of Packet-2 , Packet-5, packet-6, Packet-7 & Packet-9 will be within a limit of Vehicle-Y.

Total weight of Packet-8 , Packet-11, packet-13, Packet-14 & Packet-15 will be within a limit of Vehicle-Z.

Up to all available vehicles...

At last, no packet should be left in a factory.

I hope this above example is understood and helpful too.

Thank you.

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

Replies
1
Views
347
Replies
0
Views
85
Replies
3
Views
575
Replies
1
Views
407
Replies
4
Views
633

1,147,499
Messages
5,741,507
Members
423,663
Latest member
kaveh87rsh

### 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.

### Which adblocker are you using?

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

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