I hope I can make this clear, but it's kind of complicated (in my head anyway)
I'm trying to write this for use in steel fabrication. What I have posted below is very much a work in progress & is part of a much larger workbook doing many other things (I removed as much of the stuff irrelevant to this problem as I could quickly).
It's also worth noting I’m at the point in my VBA coding journey where I can find and adapt code, but not write it from scratch. I'm still very much learning.
I have already coded taking the basic list of materials which are listed as it’s required around the building & ordered it in a way that lists it by material, created totals & colourised it based on Finish.
For reasons you won’t care about I have to make 3 lists, but he left list is the one I need to process.
I want to use the Monte Carlo principle to work out cutting optimisation for each material type in the list.
I’ve found the solution MarvinP posted to Mrnuddles to solve the problem for 1 material which I can make that a module & that’s the basis of exactly what I need (and accurate enough for my needs).
I can’t work out how to attack the problem of smashing the 2 together to iterate through my list of materials giving the solution to each material without writing huge amounts of slow running code.
It’s the looping I can’t wrap my head around.
I think I need to:
- List the section sizes in the BOM
- Then process each section size in the list (dropping the answers into another sheet or sheets probably, but I should be able to work that bit out)
I've attached both my code & MarvinP's code in a zip file
Bookmarks