VBA & Macro Problems

Insert Cells and Shift a Specific Excel Range Down with VBA

Olivia MillerOlivia Miller Nov 14, 2026 869 views

Question details

Insert cells in a specific Excel range and shift the affected columns downward using VBA.

Insert Cells and Shift a Specific Excel Range Down with VBA
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to insert cells in columns E through H without inserting an entire worksheet row.
Observed behavior
Cells are inserted at E27:H27, shifting existing cells below them down in those columns while leaving other columns unchanged.
Before you start

Identify the target worksheet and the cells where you want to insert space. Check that shifting cells down in those columns will not disrupt related data in other columns.

Solution 1Recommended

Insert cells in a specific range with Excel VBA

Use Range.Insert with xlShiftDown to insert cells in selected columns rather than an entire row.

This example inserts cells at E27:H27. Existing cells in columns E through H at and below row 27 shift down; the shift is not limited to the original four-cell selection.

1
Open the VBA editor

In Excel, open the workbook and select Developer > Visual Basic.

2
Create a macro

In the VBA editor, select Insert > Module and enter: Sub InsertRangeCells() With ActiveSheet .Range(.Cells(27, 5), .Cells(27, 8)).Insert Shift:=xlShiftDown End With End Sub

3
Run the macro

Activate the target worksheet, then select Developer > Macros, choose InsertRangeCells, and click Run.

4
Save the macro if needed

To keep the VBA code, select File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm).

Insert cells in a specific range with Excel VBA
Check dependent data: Only columns E through H shift down. Data in other columns stays in place, so rows that previously aligned across columns may no longer match.
Insert cells in WPS Spreadsheet

Shift a selected range down in WPS Spreadsheet

Use WPS Spreadsheet to insert cells and shift the affected columns down without inserting an entire row. This is a manual alternative to the Excel VBA macro.

  1. 1. Open the workbook: Open WPS Spreadsheet and select File > Open to choose your Excel workbook.
  2. 2. Select the cells: Select E27:H27, or select the range where you want to insert cells.
  3. 3. Insert and shift down: Right-click the selection, choose Insert, and select Shift cells down.
  4. 4. Check and save: Verify that the affected columns have shifted as intended, then select File > Save As to save the workbook.
Insert cells in selected columns without adding a full worksheet rowOpen and edit Microsoft Excel .xlsx and .xls filesUse familiar spreadsheet controls in a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Does inserting E27:H27 shift only those four cells?

No. Range.Insert with xlShiftDown inserts four blank cells at E27:H27 and shifts existing cells at and below that position down in columns E through H.

How can I change the insertion range in the VBA code?

Change the row and column numbers in .Cells(27, 5) and .Cells(27, 8). For example, .Range(.Cells(10, 2), .Cells(10, 4)) targets B10:D10.

Will the macro insert a full worksheet row?

No. The Range.Insert statement with Shift:=xlShiftDown inserts cells only in the specified columns. Other columns do not shift.

How do I keep the macro in my workbook?

Select File > Save As in Excel and choose Excel Macro-Enabled Workbook (*.xlsm). A standard .xlsx file cannot retain VBA code.