Insert a Row

Inserts a row into an existing Excel worksheet.

Overview

This procedure inserts a new row into an existing Excel worksheet at a specified row number. Existing rows are shifted down. This allows you to add rows without overwriting existing content in the worksheet.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

insert a row into the worksheet

What does it do?

Begins row insertion into the current worksheet.

Where does it go?

This phrase should be written on a new line.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — A reference to the worksheet must be defined in the automation.

the row number is n

What does it do?

Specifies where to insert the new row.

Where does it go?

Indented under insert a row into the worksheet where.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — Replace n with a row number (1-based). Existing rows will be shifted down.

Example

the row number is 2
the values are "value1", "value2", "value3" ...

What does it do?

Specifies the data to insert into the new row.

Where does it go?

Indented under insert a row into the worksheet where.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace value1, value2, value3, etc. with a list of values for the row cells. If not specified, the row will be empty.

Example

the values are "John", "25", "Engineer", "New York"

Examples

1. Insert a Row by Specifying a Row Number

insert a row into the worksheet where
    the row number is 2

2. Insert a Row by Specifying a Row Number and Values

insert a row into the worksheet where
    the row number is 2
    the values are "Earth", "Water", "Fire", "Air"

Last updated

Was this helpful?