Disabling Screen Updating function is slowing down my macro

Martunis99

New Member
Joined
Aug 16, 2021
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

So I built a macro that copies some contents of files to one single sheet based on some cell values.
Since some of these files are extracted from a separate program that executes a few runs on different populations, the amount of data to be copied can sometimes amount to several thousand rows.

In an attempt to make the macro run faster, I put Application.ScreenUpdating = False in the beginning of my program and turned it back on again in the end.
However, when I disable screen updating the macro takes up to 3min to copy over 4 files, and when I don't disable screen updating the macro takes only 30sec to copy the exact same files.

Do you have any idea why in this instance disabling screen updating is actually making my macro slower?

(PS: I don't have any Select or Activates as advised and I tried to assign all my ranges to variables)

Thank you!
 

Martunis99

New Member
Joined
Aug 16, 2021
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
@Gokhan Aycan big oof... Didn't notice that! Thank you so much Gokhan, coming in clutch again! :)

I will correct it right now!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,389
Messages
5,769,798
Members
425,572
Latest member
ja189704

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top