XL.Sheet.CellWriteStyledText
----------------------------

Writes a styled text into a cell.

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

MBS( "XL.Sheet.CellWriteStyledText"; BookRef; SheetIndex; Row; Column; Text { ; Format } ) 

**MBS**( **"XL.Sheet.CellWriteStyledText";** /\* Writes a styled text into a cell. \*/  
**$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 \*/   
**$Row**; /\* The row for the cell. First row has index 0. \*/   
**$Column**; /\* The column for the cell. First column has index 0. \*/   
**$Text**; /\* The new text to write.e.g. "hello" \*/   
**$Format**) /\* Optional; The format for the cell. This is index from 0 to XL.GetFormatCount-1 in the book's list of formats.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| 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 |  |
| Row | The row for the cell. First row has index 0. | $row |  |
| Column | The column for the cell. First column has index 0. | $column |  |
| Text | The new text to write. | "hello" |  |
| Format | The format for the cell. This is index from 0 to XL.GetFormatCount-1 in the book's list of formats. | 0 | Optional |

### Result

Returns OK or error.

### Description

Writes a styled text into a cell.  
For alignment, please use the format parameter.  
### Examples

Write colored text:

 Set Variable \[ $sheet ; Value: 0 \]   
Set Variable \[ $row ; Value: 2 \]   
Set Variable \[ $col ; Value: 3 \]   
Set Variable \[ $text ; Value: TextColor ( "red"; RGB ( 255 ; 0 ; 0 ) ) &amp; " " &amp; TextColor ( "blue"; RGB (0 ; 0 ; 255 ) ) \]   
\#   
Set Variable \[ $r ; Value: MBS ( "XL.Sheet.CellWriteStyledText"; $BookRef ; $sheet ; $row ; $col ; $text ) \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.CellIsStyledText](XLSheetCellIsStyledText.md)
- [XL.Sheet.CellReadStyledText](XLSheetCellReadStyledText.md)
- [XL.Sheet.CellWriteFormulaText](XLSheetCellWriteFormulaText.md)
- [XL.Sheet.CellWriteText](XLSheetCellWriteText.md)

### Release notes

- **Version 10.2**
    - Added [XL.Sheet.CellIsStyledText](https://www.mbsplugins.eu/XLSheetCellIsStyledText.shtml), [XL.Sheet.CellReadStyledText](https://www.mbsplugins.eu/XLSheetCellReadStyledText.shtml) and [XL.Sheet.CellWriteStyledText](https://www.mbsplugins.eu/XLSheetCellWriteStyledText.shtml) functions.

### Blog Entries

- [MBS Plugin Advent calendar: 13 - XL](https://www.mbsplugins.de/archive/2023-12-13/MBS_Plugin_Advent_calendar_13_/monkeybreadsoftware_blog_filemaker)
- [Tips and tricks with MBS](https://www.mbsplugins.de/archive/2023-08-10/Tips_and_tricks_with_MBS/monkeybreadsoftware_blog_filemaker)
- [LibXL for FileMaker with extras](https://www.mbsplugins.de/archive/2021-03-02/LibXL_for_FileMaker_with_extra/monkeybreadsoftware_blog_filemaker)
- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-12/Neues_MBS_FileMaker_Plugin_102/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.2 - More than 6200 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-05-12/MBS_FileMaker_Plugin_102_-_Mor/monkeybreadsoftware_blog_filemaker)
- [Use formatted text in Excel files with FileMaker and LibXL](https://www.mbsplugins.de/archive/2020-04-23/Use_formatted_text_in_Excel_fi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.2pr4](https://www.mbsplugins.de/archive/2020-04-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2025, Seite 28](https://filemaker-magazin.de/neuigkeit/4282-Appetithappen-FMM_202501)
- [Ausgabe 5/2022, Seite 23](https://filemaker-magazin.de/neuigkeit/4196-Appetithappen-FMM_202205)

This function checks for a license.

Created 18th April 2020 , last changed 19th April 2020

  
[XL.Sheet.CellWriteNumbers](XLSheetCellWriteNumbers.md) - [XL.Sheet.CellWriteText](XLSheetCellWriteText.md)

[HTML Version](XLSheetCellWriteStyledText.shtml)