• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA taking more and more time

Pierre

Member
Hello,

I made a macro to automatize a calculation process for our warehouse. The code and calculation are correct but I noticed that over time it's taking more and more time. My colleague using the file came back to me and told me that the calculation is now taking hours.
He sent me the file he used, I tested and saw it was very slow. What I did is copy data and macro in a new file and then run the macro, it took only 2min.

Has someone ever noticed this?

I join the 2 files, is there something inside that can explain the difference in speed? Is there a way to avoid this?
 

Attachments

  • Short_calculation.xlsm
    950.8 KB · Views: 3
  • Short_calculation.zip
    889.1 KB · Views: 2
  • Long_calculation.xlsm
    901.8 KB · Views: 3
First, both files have unnecessary format beyond last data range. You can check this by using CTRL + END.

As well, Long_Calculation has another hidden sheet, which has formula dependent on column AE. This will add another layer of slow down, as each loop seems to cause this to recalculate.
 
Back
Top