XL.Book.MoveSheet
-----------------

Moves a sheet.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [7.2](newinversion72.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.Book.MoveSheet"; BookRef; SourceIndex; DestIndex ) 

**MBS**( **"XL.Book.MoveSheet";** /\* Moves a sheet. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$SourceIndex**; /\* The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1.e.g. 0 \*/   
**$DestIndex**) /\* The destination index of the sheet.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
| SourceIndex | The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1. | 0 |
| DestIndex | The destination index of the sheet. | 0 |

### Result

Returns OK or error.

### Description

Moves a sheet.  
Takes a sheet with SourceIndex and insert it in front of a sheet with DestIndex.   
Returns OK on success and error on failure.  
### See also

- [XL.Book.AddSheet](XLBookAddSheet.md)
- [XL.Book.DeleteSheet](XLBookDeleteSheet.md)
- [XL.Book.InsertSheet](XLBookInsertSheet.md)
- [XL.Book.SheetCount](XLBookSheetCount.md)

### Release notes

- **Version 7.2**
    - Added [XL.Book.MoveSheet](http://www.mbsplugins.eu/XLBookMoveSheet.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 7.2pr5](https://www.mbsplugins.de/archive/2017-05-08/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th April 2017 , last changed 27th April 2017

  
[XL.Book.IsWriteProtected](XLBookIsWriteProtected.md) - [XL.Book.PictureCount](XLBookPictureCount.md)

[HTML Version](XLBookMoveSheet.shtml)