1 Attachment(s)
Solved: Code for vba to replace below formula
Hi all
I have been using a planning system which till now was working very well and also I was able to build the planning system with the help from vb express itself. Thanks a lot for the this help.
But the way it was working till now was very helpful with the formula and then I was using a vba code to copy paste the formula into values every time so that not to increase the size of the file.as this is a part of the planning system
The formula is as such IF($R19="",0,IF(F$33<$O19,0,IF(F$33>=$O19,IF(0<($AA19),MIN(($AA19-SUM(E19:$AF19)),$AB19,SUMIF(Shadow_km_Module,$R19,F$3:F$32)-SUMIF($R18:$R$34,$R19,F$34)),0))))
This formula is the heart for the planning system without this the planning is nothing as every time all analysis is done first with this and others can be done.
I have attached the file so that you can have a better idea of how it works..you can click on the button to see how it works to have an idea. Or just copy the formula from the parameter data and paste it on the shadow_k_mins where the calendar starts the calculation area is not formatted but when there is figures it will format through conditional formatting..
When the system is running there is lot of anaylsis which shall be generated at one go.
As you know every time that an order is not respecting the dates it shall be changed and the analysis shall be run again to have a better results and this has been done till now with 500-600 rows analysis at one go.
But now it will be working with almost 500 to 6000 rows almost 3 -4 times than the actual. And this will take a lot of time for the anaylsis. I have made a simulation with 2000 rows it has freeze and after almost 3 -4 mins that the anaylsis has been done and it very time consuming. All other parts has been program using vba. Its only this part that uses formula..
What I need is how I can program this through vba instead of using the formula. And this will be very beneficial for the planning system and also for the user.
1 Attachment(s)
Code for vba to replace below formula
Hi ok i have understand the way you have program.
i have included another sheet on the data files2 where this one also i am using the formula sumif like this:
shadow_k_mins!AG2-SUMIF(shadow_k_mins!$R$35:$R$1544,shadow_k_mins!$AD2,shadow_k_mins!AG$35:AG $1544)
and after that i used vba to copy and paste as values. you can click on the button still to load minutes to see the calculation.
This one will calculate the still to plan minutes which later i used to convert to operators after the planning system has already plan the produce mins on the shadow_k_mins.
but still this one as you see will limit and will take times to run.
can you please help on that as i have been trying to used the same programming logic you used for the shadow_k_mins calculation but till now its not working.
many thanks for your help.