Jul 21 2018 04:55 AM
Jul 21 2018 06:52 AM
We need to see this macro to figure out what the problem is.
Please copy the macro code here in a reply.
It would be better if you can attach the workbook itself.
Jul 23 2018 07:19 AM
Thanks for taking the time to look at it.
I have attached a copy of the workbook (I have put random names in the name column, but that does not affect the macro). I am not a sophisticated programmer and don’t know all the shortcuts in coding, but the macro does what I want it to do, it just takes too much time, and once it exits, the workbook is slow to navigate until I close it and reopen it.
The macro does two basic procedures:
If you see a fix, just send me a copy to the revised macro with any comments you want to make.
Jul 25 2018 10:07 AM
Sorry on the late reply!
The macro performs a very long operation, and includes several For Loops statements, this is why it takes too much time!
Another reason, there are too many Conditional Formatting rules in the worksheet!
However, I've updated the macro to speed up the operation, please test it in the attached file.
Also, please review Conditional Formatting rules in the worksheet and see if you really need them all.
Jul 25 2018 02:48 PM
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!
Jul 25 2018 09:00 PM
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 site, please check it out to see the full explanation of these codes.
Feb 25 2021 11:31 AM
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.
Feb 26 2021 05:04 AM
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?