This macro is able to balance operation load on different resources, so that their end times are as close to each other as possible. The operations to balance are selected in the Gantt chart.
Balancing is done by continuously moving quantity from the operation ending the latest to the operation ending the earliest. This is done until the spanThreshold is met (See _Parameters) or the macro have executed 100 attempts without finding a balanced solution. In cases where the product name is the same for all operations, the balancing will just increase/decrease operation quantity. If one or more operations have different product names, some of the operations will end up being split and the new part moved to a different resource. I.e. this ensures that quantity is only shifted around operations producing the same product.
The operations selected for balancing must be located on different resources and be set to use quantity/capacity.
The balancing will never commit a solution when the latest end time of the operations have not been improved with at least this parameter value (in hours).
The balancing will stop when it finds a solution, where the span between the latest end and earliest end is less than of equal to this parameter value (in hours).