# Moving a Sheet

Explore the AllowSheetMove property and SheetDragMoving event to customize sheet movement behavior.

## Content

If you have multiple sheets, you can move a sheet. If you move the first sheet location to the last sheet location, then the other sheets are moved to the left. If you move the sheet location to the location of the sheet next to it, then this effectively swaps the sheets.
Specify the from and to location using the sheet index. The sheet index is zero‑based.
Moving a sheet does not change the sheet name.
The [AllowSheetMove](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.AllowSheetMove.html) property of the **FpSpread** class can be set to true to allow the user to move the sheets using the sheet tabs. You can also hide a sheet. For more information, refer to [Showing or Hiding a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheethide).
You can prevent a user from moving a specific sheet with the [SheetDragMoving](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SheetDragMoving.html) and [SheetDragMoved](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SheetDragMoved.html) events. Select a sheet tab on the tab strip, drag the sheet tab to another tab, then release the mouse to move the sheet from the old index to the new index. The [SheetDragMoving](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SheetDragMoving.html) event occurs when the user starts dragging the sheet tab name. The [SheetDragMoved](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SheetDragMoved.html) event occurs right after the user moves the sheet. You can prevent specific sheets from being moved by setting the **Cancel** property to true in the [SheetDragMoving](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SheetDragMoving.html) event.
To move an existing sheet, complete the following instructions.

## Method to set

Call the Sheets [Move](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetViewCollection.Move.html) method (to move the sheet from one location to another).

## Example

This example code moves the second sheet to the location of the third sheet.

```csharp
// Move sheet 2 to the location of sheet 3.
fpSpread1.Sheets.Count = 5;
fpSpread1.Sheets.Move(2, 3);
```

```vbnet
' Move sheet 2 to the location of sheet 3.
fpSpread1.Sheets.Count = 5
fpSpread1.Sheets.Move(2, 3)
```

## See Also

[Sheets](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet)
[Working with the Active Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetactive)
[Working with Multiple Sheets](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetmulti)
[Adding a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetadd)
[Removing a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetremove)
[Showing or Hiding a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheethide)
[Copying and Inserting a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetcopy)
[Adding a Title and Subtitle to a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheettitle)
[Placing Child Controls on a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheet-childcontrols)
[Displaying a Footer for Columns or Groups](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-columnfooter)
[Adding a Tag to a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-tags-sheet)
[Working with 1-Based Indexing](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/working-with-1based-indexing)