# Adding a Row or Column

Learn how to add columns and rows to a sheet in Spread.NET with the AddRows and AddColumns methods.

## Content

You can add one or more columns or rows to a sheet, and specify where the column or row is added. You can use the [AddRows](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddRows.html) method and [AddColumns](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddColumns.html) method of the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class to add row and column respectively.
If you set the cell type for the column and a row is inserted, the new cells in the column use the cell type for the entire column. If you set the cell type for individual cells and a new row is inserted, then the new cells use the default cell type, and you would need to set the cell type for each of the new cells.
For more details refer to the SheetView.[AddRows](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddRows.html) method or SheetView.[AddColumns](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddColumns.html) method.

## Using a Shortcut

* Call the **AddColumns** or **AddRows** method for the Sheets shortcut object.
* Set the *column* or *row* parameter to specify the column or row before which to add the columns or rows.
* Set the *count* parameter to specify the number of columns or rows to add.

**Example**
This example code adds two columns before 7th column.

```csharp
fpSpread1.Sheets[0].AddColumns(6,2);
```

```vbnet
fpSpread1.Sheets(0).AddColumns(6,2)
```

## Method to set

1. Use the [AddRows](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddRows.html) or [AddColumns](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.AddColumns.html) method for a [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) object.
2. Set the *column* or *row* parameter to specify the column or row before which to add the columns or rows.
3. Set the *count* parameter to specify the number of columns or rows to add.

**Example**
This example code adds two columns before 7th column.

```csharp
FarPoint.Win.Spread.SheetView Sheet0;
Sheet0 = fpSpread1.Sheets[0];
Sheet0.AddColumns(6,2);
```

```vbnet
Dim Sheet0 As FarPoint.Win.Spread.SheetView
Sheet0 = fpSpread1.Sheets(0)
Sheet0.AddColumns(6, 2)
```

## Using the Spread Designer

1. Select the sheet tab for the sheet for which you want to add a row or column.
2. Select a row above which you want to add a row or a column to the left of which you want to add a column.
3. Right-click on the row or column and choose **Insert**.
<br>
    An additional row or column is added to the sheet.
4. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.

## See Also

[Rows and Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol)
[Customizing the Number of Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolnumber)
[Removing a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolremove)
[Showing or Hiding a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolhide)
[Setting the Row Height or Column Width](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolsize)
[Setting Fixed (Frozen) Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-freeze)
[Moving Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-usermove)
[Creating Alternating Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolalt)
[Setting up Preview Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-previewrow)
[Input Data in Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-userentry)
[Rows or Columns That Have Data](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolnonempty)
[Adding a Tag to a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-tags-rowcol)