VBA & Macro Problems

Copy Row 1 Below the Active Cell with an Excel VBA Macro

Jason MillerJason Miller Nov 27, 2026 869 views

Question details

The user wants to copy a template in row 1 and insert it immediately below the row containing the active cell.

Copy Row 1 Below the Active Cell with an Excel VBA Macro
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet uses row 1 as a template, including checkboxes, for new rows.
Observed behavior
The desired result is a copy of the template inserted below the active row, with the template checkboxes hidden when row 1 is hidden.
Before you start

Make sure row 1 contains the template and the worksheet allows rows to be inserted. Save the workbook as an Excel Macro-Enabled Workbook (.xlsm) and enable macros only if you trust the workbook.

Solution 1Recommended

Insert a Copy of Row 1 Using an Excel VBA Macro

Use this macro to insert the template immediately below the row containing the selected cell.

1
Open the VBA editor

In Excel, open the workbook and press Alt+F11. In the VBA editor, select the workbook and choose Insert > Module.

2
Add the macro

Paste this code into the module: Sub InsertTemplateRow() Rows(1).Copy ActiveCell.Offset(1).Insert End Sub

3
Select the insertion point

Return to the worksheet and click any cell in the row immediately above where you want the copied template inserted.

4
Run the macro

Press Alt+F8, select InsertTemplateRow, and click Run. Excel inserts a copy of row 1 below the active row.

5
Set checkbox placement

For each template checkbox, right-click it, choose Format Control, open the Properties tab, and select Move and size with cells. Then hide row 1 using its row header.

Insert a Copy of Row 1 Using an Excel VBA Macro
Check the copied controls: The Format Control setting applies to form-control checkboxes. After inserting a row, check that the copied controls are positioned as expected.
Free Microsoft Office alternative

Work with Template Rows in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open compatible Excel files and work with template rows while moving between office suites.

Copy and insert spreadsheet rows using familiar editing toolsCompatible with Microsoft Excel formats such as XLSX and XLSLightweight suite with a familiar Office-style interfaceOpen existing spreadsheets to support migration from Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Does the macro replace the row below the active cell?

No. ActiveCell.Offset(1).Insert inserts the copied row below the active cell, shifting existing rows downward.

How do I keep the template checkboxes from appearing when row 1 is hidden?

Right-click each form-control checkbox, choose Format Control > Properties, and select Move and size with cells. Then hide row 1 from its row header.

How do I save the macro in my workbook?

Choose File > Save As and select Excel Macro-Enabled Workbook (.xlsm). A standard .xlsx file cannot retain VBA macros.

Which worksheet does the macro use?

The macro uses row 1 and the active cell on the active worksheet. Select the intended worksheet and cell before running it.