Speed up macro screenupdating

Rated 4.2/5 based on 539 customer reviews

Dim ws As Worksheet 'Step 2: Turn screen updating off to speed up your macro code Application. Close Save Changes:=True 'Step 6: Loop back around to the next worksheet Next ws 'Step 7: Turn screen updating on Application.Screen Updating = False 'Step 3: Start the looping through sheets For Each ws In This Workbook.

Very cool :)The only thing I'd change is saving the initial settings in a static variable in the sub when calling the sub with true and set back to the original settings using the values in the static variable when calling the sub with false.This article lists my top rules for speeding up VBA.It is easy to lapse into bad programming habits when working with small macros, but with large macros and macros that run a long time it is critical to use efficient coding. Generally, functions are called by other code, so you would not want to toggle these settings within functions. This subroutine should only be called within your main sub.

Leave a Reply