Forum Discussion
slow after running macro
Hi Haytham,
Thanks so much. It runs much faster. I saw you added some code at the front of my macro - one of which doesn't allow the macro to update the screen which I could see takes a huge amount of time. I'm not sure what the others do, but if you could point me to where I could find out, I'd appreciate it. I need the conditional formatting so it is easy for the other golfers to visually see how they are doing and what holes they need to work on.
You have been a big help!
Bruce
Thank you!
The idea behind these codes is to turn off everything that may lead to slow down the macro and not necessary for its operation.
In fact, this is the first time I use these codes in separate Subs and then call it inside the main Sub.
I took this idea from this https://www.thespreadsheetguru.com/blog/2015/2/25/best-way-to-improve-vba-macro-performance-and-prevent-slow-code-execution, please check it out to see the full explanation of these codes.
Regards
- TAntolikFeb 25, 2021Copper Contributor
Good morning, I am having the same issue. I am not a coder. I grabbed a code off the internet that would allow me to sum by color. Now the xlsm file is running extremely slow. I've attached a copy of the excel. Can you help me?
- JMB17Feb 25, 2021Bronze Contributor
Mostly, I would say it is due to the fact that you are passing entire columns (1 million+ cells) to the function to loop through.
I changed the functions to restrict the range it looks at to the used range, but sometimes the worksheet's used range needs to be reset so you may need to check/reset it if you notice it bogging down again. Or, just pass your actual range to the function instead of the entire column.
- TAntolikFeb 26, 2021Copper Contributor
Good morning, and Thank you so much!
I was wondering, typically we have multiple sheets in our workbook but I only want the macro to run on one of the sheets. Am I able to assign this macro to only run on one sheet rather than the many sheets we may have in a workbook?