How to speed up my code

Solved/Closed
Trowa - Jul 23, 2010 at 08:21 AM
 Trowa - Jul 27, 2010 at 08:55 AM
Hello,

Let me start by posting my workbook:
https://authentification.site/files/23489429/Copy_of_PostPlanning.xls

When you go to sheet "Alle opdrachten" you will see red and green lines. When you click the button "Voltooide opdrachten afvoeren", the green lines will be moved to the next sheet "Voltooide opdrachten".

When I first implemented the code (credit goes to Rizvisa) everything was working smoothly. But now, after adding more codes to the workbook, it takes forever.

What are my options for running the code faster? Do I need to cut something out?
Please advise?

Best regards,
Trowa

1 reply

rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
769
Jul 23, 2010 at 06:09 PM
Your issue are the events. As the code is running, all sort of events are fired up
Worksheet_Change
and Selection_change etc

Now I dont know if you do want the code to fire these events as macro is running or do you want to do it if the user does some thing.
If you want to disable events while code is running, you can add a line

Application.enableevents = false


and once the code is done running, add
application.enableevents = true
0
Thanks Rizvisa, exactly what I needed. Code is running smoothly again.

Kind regards,
Trowa
0