logo
search
VBA & Macro Problems

How to Speed Up Slow Excel VBA Macros by Avoiding Select and Activate

Bushra ParveenBushra Parveen Oct 13, 2026 869 views

Question details

The user wants to improve the execution time of slow Excel VBA macros caused by inefficient worksheet and range selections.

How to Speed Up Slow Excel VBA Macros by Avoiding Select and Activate
Product
Excel
Device & OS
not provided
Scenario
Running VBA macros that involve repeatedly moving between worksheets, selecting ranges, copying, and pasting data.
Observed behavior
The macro execution takes unnecessarily long and becomes less reliable because of repeated activation and selection of worksheets and ranges.
Before you start

Before modifying your code, save a backup copy of your macro-enabled workbook (.xlsm) to ensure you have a working version in case of errors.

Solution 1Recommended

Work Directly with Worksheet and Range Objects

Replace inefficient Select and Activate methods with direct references to Worksheet and Range objects to bypass interface updates and execute code much faster.

Using .Select or .Activate forces Excel to physically update the user interface and switch the active window context. By modifying ranges and moving data directly in the background, you bypass these visual updates, drastically cutting down execution time.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to launch the Visual Basic for Applications Editor, then locate your macro module in the Project Explorer.

2
Locate inefficient code

Search your code for instances of '.Select', '.Activate', 'Selection', and 'ActiveSheet'.

3
Combine copy and paste operations

Rewrite separate copy and paste commands into a single statement. For example, replace 'Sheets("Sheet1").Select' and 'Range("A1:A4").Select' followed by copy/paste commands with 'Worksheets("Sheet1").Range("A1:A4").Copy Destination:=Worksheets("Sheet2").Range("D1")'.

4
Test the optimized macro

Save your code and run the macro to verify that it executes successfully without visual stuttering and with reduced execution time.

Work Directly with Worksheet and Range Objects
Code Reliability: Bypassing the active screen context not only speeds up the macro but also makes it less prone to errors if a user accidentally clicks on the spreadsheet while the macro is running.

Run and Optimize VBA Macros Seamlessly in WPS Spreadsheet

WPS Office offers robust, built-in support for VBA macros. You can edit, run, and optimize your VBA scripts directly within WPS Spreadsheet, utilizing direct object references to execute heavy workloads with exceptional speed.

  1. 1. Open your macro-enabled file: Launch WPS Spreadsheet and open your existing .xlsm or .xlsb workbook.
  2. 2. Access the Developer tab: Navigate to the Developer tab on the top ribbon menu.
  3. 3. Open the VBA Editor: Click on 'VBA Editor' to access your modules and apply the optimized direct range references.
  4. 4. Run your macro: Execute the streamlined macro directly from the editor or a custom workbook button to experience the performance gains.
Fully compatible with Microsoft Excel VBA syntax and objectsHigh-performance macro execution for heavy datasetsLightweight application that loads .xlsm and .xlsb files quicklyBuilt-in VBA editor identical to standard Microsoft Office formats
microsoft office alternative - wps office

Frequently Asked Questions

Why are .Select and .Activate so slow in VBA?

These methods force Excel to physically update the user interface and switch the active window context. This requires significantly more processing power and time compared to modifying the data in the background using direct object references.

Can I format cells directly without selecting them first?

Yes. You can apply formatting directly to a Range object. For example, use 'Range("A1:A10").Font.Bold = True' instead of selecting the range first and applying the format to 'Selection'.

Besides removing Select and Activate, how else can I speed up my VBA code?

You can disable unnecessary Excel features during macro execution. Set 'Application.ScreenUpdating = False', 'Application.Calculation = xlCalculationManual', and 'Application.EnableEvents = False' at the start of your macro, and restore them to their default values at the end.

What is the correct syntax to copy and paste without selecting?

You can perform a copy and paste in a single line using the Destination argument. The syntax is: SourceRange.Copy Destination:=TargetRange. For example: 'Worksheets("Sheet1").Range("A1").Copy Destination:=Worksheets("Sheet2").Range("B1")'.