How to Speed Up Slow Excel VBA Cut and Insert Operations
Question details
The user is experiencing severe performance issues when running an Excel VBA macro that repeatedly cuts and inserts entire rows within a loop.

- Product
- Excel VBA
- Device & OS
- not provided
- Scenario
- Executing a VBA subroutine that modifies spreadsheet structure by continuously cutting rows and inserting them elsewhere, often called from another parent subroutine.
- Observed behavior
- The macro runs extremely slowly because Excel is forced to recalculate, redraw, and shift the worksheet layout after every individual cut and insert operation.
Save a backup copy of your Excel workbook (.xlsm) before modifying your macro code, as structural VBA changes cannot be undone using the standard Undo button.
Disable Application Events and Screen Updating
Temporarily turn off Excel's background processes like screen refreshing and automatic calculations while the macro runs to drastically improve execution speed.
Excel's default behavior is to visually redraw the screen and recalculate formulas every time a row is inserted or deleted. By disabling these application-level features at the start of your subroutine and re-enabling them at the end, your macro can perform operations in the background instantly.
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor, then locate the module containing your slow subroutine.
At the very top of your macro (right after the 'Sub' declaration), add the following lines: Application.ScreenUpdating = False, Application.EnableEvents = False, and Application.Calculation = xlCalculationManual.
At the bottom of your code, just before 'End Sub' or within your error-handling block, restore these settings: Application.ScreenUpdating = True, Application.EnableEvents = True, and Application.Calculation = xlCalculationAutomatic.

Process Rows from the Bottom Upwards
Reverse your loop direction to prevent Excel from constantly shifting row index numbers of the rows you have not yet processed.
Replace Cut/Insert Operations with Sorting Methods
Avoid row-by-row cutting and inserting entirely by using Excel's built-in Sort method combined with custom lists to restructure data in one bulk operation.
Open Large Datasets Faster with WPS Office
If your macro-heavy Excel workbooks are frequently freezing or running slowly, consider handling complex data processing in WPS Office. WPS Spreadsheets is a lightweight, highly optimized alternative that handles massive datasets and intricate formulas with incredible speed while maintaining strict compatibility with Microsoft Excel files.
- 1. Download the Installer: Visit the official WPS website and click the download button for your operating system.
- 2. Install WPS Office: Run the downloaded executable file and follow the on-screen prompts to complete a quick installation.
- 3. Open Your Spreadsheet: Launch WPS Spreadsheets and open your .xlsx or .xlsm file to instantly view your data in a fast, familiar environment.

Frequently Asked Questions
Why is my VBA macro slow when called from another subroutine, but fast on its own?
When you use the 'CALL' statement from a parent subroutine, the parent routine might have Application Events, ScreenUpdating, or Automatic Calculations enabled. It may also hold onto system resources. To fix this, ensure your top-level subroutine toggles these Application settings off before making the 'CALL'.
What is the fastest way to delete multiple rows in Excel VBA?
The fastest method is to use the Union function to group all rows you want to delete into a single Range object while looping, and then delete the entire Union range in one single command at the end of the loop, bypassing the need to delete rows iteratively.
Does disabling EnableEvents in VBA affect my formulas?
No, Application.EnableEvents = False only prevents Excel from triggering event macros (like Worksheet_Change). It is Application.Calculation = xlCalculationManual that stops formulas from recalculating. Both are safe to disable temporarily as long as you re-enable them at the end of your script.




