Insert Cells and Shift a Specific Excel Range Down with VBA
Question details
Insert cells in a specific Excel range and shift the affected columns downward using 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.
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.
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.
In Excel, open the workbook and select Developer > Visual Basic.
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
Activate the target worksheet, then select Developer > Macros, choose InsertRangeCells, and click Run.
To keep the VBA code, select File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm).

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. Open the workbook: Open WPS Spreadsheet and select File > Open to choose your Excel workbook.
- 2. Select the cells: Select E27:H27, or select the range where you want to insert cells.
- 3. Insert and shift down: Right-click the selection, choose Insert, and select Shift cells down.
- 4. Check and save: Verify that the affected columns have shifted as intended, then select File > Save As to save the workbook.

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.




