# Insert a Row

### 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.

<details>

<summary><code>insert a row into the worksheet</code></summary>

#### 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.

</details>

<details>

<summary><code>the row number is n</code></summary>

#### 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
```

</details>

<details>

<summary><code>the values are "value1", "value2", "value3" ...</code></summary>

#### 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"
```

</details>

### 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"
```
