Wauvel

Excel like a finance pro.

← The library

VBA · Performance

Avoiding Select and Activate

Working with ranges directly is faster and more reliable than selecting them first.

Very commonDifficulty 1100 · Proficient
Practice · 2 questions →

When to use it

Selecting a range and then working with Selection is what the recorder writes. Working with the range directly is faster, does not move the user's cursor, and works on sheets that are not active.

The code

Code
' slow
Range("A1").Select
Selection.Value = 1
' better
Range("A1").Value = 1

Worked examples

  • Drop Select

    ' slow Range("A1").Select Selection.Value = 1 ' better Range("A1").Value = 1 The same result without the Select

    Delete Select/Selection pairs.

  • Other sheets

    Worksheets("Data").Range("A1").Value = 1 Writes to a sheet that is not active

    No Activate needed.

  • Format without selecting

    With Worksheets("Data").Range("A1:C10") .Font.Bold = True .Interior.Color = vbYellow End With Formats without selecting

    With blocks replace Select.

Worth knowing

  • Search recorded code for .Select and .Activate and remove them one by one.
  • Copy Destination:= and direct Value assignment avoid selection for copying.
  • Only user-facing utilities should read the selection.

Where it goes wrong

  • Select fails on hidden sheets and on sheets that are not active.
  • Selecting scrolls the user's view around.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.