Microsoft Excel – Macros – Import performance improvements

When importing a comma separated tet file (CSV) or tab separated text file using a macro, you can significantly improve performance by adding a few lines of code.

At the start of your import routine add the following lines:

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False

At the end of your import routine add the following lines:

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayStatusBar = True

By stopping Excel from checking if any cell formulas need recalculating when a record is imported combined with disabling screen refresh/redraw combined with updating the status bar, the import routine performance can be improved significantly with little to no effort.

Microsoft Excel – Macros – Import performance improvements was last modified: February 14th, 2017 by tabcom