# Insert Column

> `UiPath.Excel.Activities.Business.InsertColumnX`

`UiPath.Excel.Activities.Business.InsertColumnX`

Inserts a column in a sheet, table, or range at the specified location. You can add a column header and select how to format the data in the column. The activity can be used with an Excel file selected for a parent [Use Excel File](https://docs.uipath.com/activities/other/latest/productivity/excel-application-card) activity or with the Project Notebook.

## Configuring the activity

#### In the body of the activity

* **Range** - Select **Plus** on the right side of the field, then, from the menu, select the file and then a sheet, table, or range where to insert the column, or select **Indicate in Excel** to indicate a range directly from the file. Alternatively, you can select **Custom Input** to enter a range, table name, or sheet name manually, or **Open in Advanced Editor** to enter a VB expression.
* **Has headers** - If this option is selected, it indicates that the first row in the defined source range is a header row. When you then indicate where to insert the column, the values in the column headers are displayed in **Relative to column** > **Range**, enabling you to identify the column next to which to insert the new column. If this option is not selected, **Relative to column** > **Range** displays column letters when the source range is a sheet or a range, or header row values when the source range is a table.
* **Relative to column** - Select **Plus** on the right side of the field, and then select **Range** and the existing column next to which to insert the new column. Depending on your selections for **Source range** and **Has headers**, the columns can be identified by the values in the first row of the selection or the letter of the column.
* **Where** - Select if the column should be added before or after the column selected for **Relative to column**.
* **Add header** - Select **Plus** on the right side of the field, and then use one of the options in the menu to select a value to add as header in the first row of the new column. If no header is defined, the cell in the first row of the new column is blank.

  + **Range** - Select one of the column headers from the source range.
  + Select an Excel file and then a named cell whose contents to use as header, or select **Indicate in Excel** to indicate a cell directly from the file.
  + **Use Saved Value** - Select a value that you previously saved for later use in the project.
  + **Text** - Enter text in the Text Builder.
  + **Ask when run** - Prompt for a value when the project is executed.
  + **Open in Advanced Editor** - Enter a VB expression.
* **Format data as type** - Select **Set Format** to open the Format data as type window, and then select the format for the data in the new column from the Category drop-down list: General, Number, Date, Time, Percentage, Currency, Text, or Custom. Depending on your selection, other options may appear for additional configuration.
:::note
By default, Excel uses the format of the column to the left. To explicitly set the format of the new column, use the **Set Format** button.
:::

#### Properties panel

**Common**

* **DisplayName** - The name displayed for the activity in the Designer panel.

**Input**

* **Add header** - See **Add header** in the body of the activity.
* **Relative to column** - See **Relative to column** in the body of the activity.
* **Range** - See **Range** in the body of the activity.
* **Where to insert** - See **Where** in the body of the activity.

**Misc**

* **Private** - If selected, the values of variables and arguments are no longer logged at Verbose level.

**Options**

* **Has headers** - See **Has headers** in the body of the activity.
