XL.Sheet.SetBorder
------------------

Sets the border in the specified range of cells.

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

MBS( "XL.Sheet.SetBorder"; BookRef; SheetIndex; rowFirst; rowLast; ColFirst; ColLast; borderStyle; borderColor ) 

**MBS**( **"XL.Sheet.SetBorder";** /\* Sets the border in the specified range of cells. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$SheetIndex**; /\* The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1.e.g. 0 \*/   
**$rowFirst**; /\* The first row for the area. First row has index 0.e.g. $row \*/   
**$rowLast**; /\* The last row for the area. First row has index 0.e.g. $row \*/   
**$ColFirst**; /\* The first column for the area. First column has index 0.e.g. $column \*/   
**$ColLast**; /\* The last column for the area. First column has index 0.e.g. $column+1 \*/   
**$borderStyle**; /\* The border style. \*/   
**$borderColor**) /\* The border color. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
| SheetIndex | The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1. | 0 |
| rowFirst | The first row for the area. First row has index 0. | $row |
| rowLast | The last row for the area. First row has index 0. | $row |
| ColFirst | The first column for the area. First column has index 0. | $column |
| ColLast | The last column for the area. First column has index 0. | $column+1 |
| borderStyle | The border style. |  |
| borderColor | The border color. |  |

### Result

Returns OK or error.

### Description

Sets the border in the specified range of cells.  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.SetColumn](XLSheetSetColumn.md)
- [XL.Sheet.SetFooter](XLSheetSetFooter.md)
- [XL.Sheet.SetHCenter](XLSheetSetHCenter.md)
- [XL.Sheet.SetHeader](XLSheetSetHeader.md)
- [XL.Sheet.SetHidden](XLSheetSetHidden.md)
- [XL.Sheet.SetPaper](XLSheetSetPaper.md)
- [XL.Sheet.SetProtect](XLSheetSetProtect.md)
- [XL.Sheet.SetRowPx](XLSheetSetRowPx.md)
- [XL.Sheet.SetVCenter](XLSheetSetVCenter.md)

### Release notes

- **Version 15.2**
    - Added [XL.Sheet.SetBorder](https://www.mbsplugins.eu/XLSheetSetBorder.shtml) to set border fo sheet.

### Blog Entries

- [MBS FileMaker Plugin, version 15.2pr2](https://www.mbsplugins.de/archive/2025-04-07/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 5th April 2025 , last changed 5th April 2025

  
[XL.Sheet.SetAutoFitArea](XLSheetSetAutoFitArea.md) - [XL.Sheet.SetCellFormat](XLSheetSetCellFormat.md)

[HTML Version](XLSheetSetBorder.shtml)