This information was fantastic. I am estimating that I reduced macro run time from 7 1/2 hours to just 1 1/2 hours.
Saved about 1 hour of run time and was super easy to implement. There was an additional benefit in that becauseI turned ScreenUpdating for the entire time, I moved other database initialization
steps to an startup section. This allowed me to initial the database once instead of for each of 28 weekly runs. This improved programming saved more time.
Also saved significant amount of time. This was more challenging to implement in that I initially turned in on for just the one step where the calculations are actually done. Part that did not work initially. I got it working by also having this feature in Automatic mode when a moved the calculated values to the output spreadsheet. Likely because I am pasting both values and format.
I implemented the With Sheets suggestion. Not sure why it worked for some command and not others.
Despite the HUGE improvement in reducing the time to run the code, I would still like to know if there are any time saving technique for these particular commands.
I don't understand why
did not seem to work. If it is pilot error and this should work that would be good to know. I use this almost 3,300 times in the 90 minute run time, so any time savings would be significant.
Seems like there should also be a better way to reset consecutive data filters. I am currently using
Thanks for all the input. Very pleased with the improvement just trying to ensure there is no more improvements to make.
There was also some interest in the complete code being used. I would be happy to share if would help someone. This would be very very long and because it is repetitive, I will start by sharing:
1) The part that get repeated 39 for each of the 39 different areas.
2) The initialization of the database that is now only used once at the start of each of 28 different weeks.
3) The master macro that calls each of 28 different macros. I also reduced speed by commenting out some of the older (lower numbered) weeks because the number of updates is reduced as the data ages.
If I can help provide more information, just let me know. The balance of this post is the code mentioned above.
1)
2)
3)
Bookmarks