Hi I have a list of 20 terminals with check boxes besides them and upon clicking each box several cost values show up in a table calculating the total costs associated with choosing that terminal. You can choose any combination of the 20 from 1 to 20 and the cost always displays in the same cell so with running each combination I would need to grab the value of that cell and compare it to the last combination.
I need to write a code that will run through all the scenarios and choose the scenario with the lowest cost, then either select those terminals or just have a msg box with the most cost effective choice.
I'm not sure how to code all the permutations as the number of combinations is 20! and doing nested loops will take forever. Unfortunately my vb skills are not advanced enough to tackle this one but I'm sure there is a better way than 20+ nested loops.
If it's not too much to ask I would be curious to know the top 3 or 5 cost effective combinations, but if that's too much just the cheapest is great.
Thank you.
Martyna
I need to write a code that will run through all the scenarios and choose the scenario with the lowest cost, then either select those terminals or just have a msg box with the most cost effective choice.
I'm not sure how to code all the permutations as the number of combinations is 20! and doing nested loops will take forever. Unfortunately my vb skills are not advanced enough to tackle this one but I'm sure there is a better way than 20+ nested loops.
If it's not too much to ask I would be curious to know the top 3 or 5 cost effective combinations, but if that's too much just the cheapest is great.
Thank you.
Martyna