PDA

View Full Version : Is this possible with VBA?



rdincer
12-01-2011, 11:09 AM
Basically for work I need to come up with a software or an excel program to make a calculation.

Let's say I have cubicle stones that have the same volume but different weight. I'm trying to put these stones into bags which differ in the number of stones they can fit, and the max weight then can carry.

To give you an example:
I have 50 cubic stones, all different weight but same volume.
I have unlimited number of different types of bags, such as:
-First type of bag can fit 3 stones in the total weight of 50kg for $10 per bag
-Second type of bag can fit 10 stones in the total weight of 100kg for $20 per bag
-Third type of bag can fit 30 stones in the total weight of 250kg for $50 per bag

I want to have an application or an excel spreadsheet which would let me put in the parameters of the bags and the stones, and then calculate the least expensive way of buying bags.

If somebody could show me a way to do this, I'll be glad.

Thanks!

mdmackillop
12-01-2011, 12:25 PM
Welcome to VBAX
This looks like a "homework" question. Please refer to our FAQ

rdincer
12-01-2011, 12:33 PM
Welcome to VBAX
This looks like a "homework" question. Please refer to our FAQ

I looked at the "homework" section and I understand why you were referring to it, my question definitely looks like a homework question.

I can assure you though that this is not a homework question. If it was, I would disclose that.

I'm weak with VBA, so I'm definitely open to paying for the solution that will work and do what I'm looking to do.

Thanks

Kenneth Hobs
12-01-2011, 12:58 PM
You do not need VBA to solve that problem.

rdincer
12-01-2011, 01:15 PM
You do not need VBA to solve that problem.

So could you tell me what I need to solve this problem so that I can start learning it?

Also just to add more info to the question: I might have up to 250 different weighted stones and probably 20 types of different priced bags which can carry different loads.

I tried to do it with Fortran last night but I got stock since I didn't know how to put a limit on the amount of stones a bag can have

I'm trying to make the program to select stones according to their weight and put them in bags in groups to give me the least expensive way to buy the bags. The groups can have 1-2-3-4-5...10...50 units, it doesn't have to group them in 5's or 10's.