XL.Sheet.CellWriteTexts
-----------------------

Writes texts to an area of cells.

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

MBS( "XL.Sheet.CellWriteTexts"; BookRef; SheetIndex; First row; Last row; First column; Last column; Values { ; Row Delimiter; Column Delimiter; DoBlanksForEmptyText } ) 

**MBS**( **"XL.Sheet.CellWriteTexts";** /\* Writes texts to an area 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 \*/   
**$First row**; /\* The first row to process. First row has index 0.e.g. 3 \*/   
**$Last row**; /\* The last row to process. First row has index 0.e.g. 6 \*/   
**$First column**; /\* The first column to process. First column has index 0.e.g. 2 \*/   
**$Last column**; /\* The last column to process. First column has index 0.e.g. 4 \*/   
**$Values**; /\* The values to use.  
Can be separated with row and column delimiter to give each row and column a different value.  
But you can also use same value for all rows or for all columns.e.g. "Test" \*/   
**$Row Delimiter**; /\* Optional; The row delimiter for the result.  
Default is new line character.e.g. "¶" \*/   
**$Column Delimiter**; /\* Optional; The column delimiter for the result.  
Default is tab character.e.g. char(9) \*/   
**$DoBlanksForEmptyText**) /\* Optional; Whether to write blank cells.  
If you pass an empty value for a cell, we can either make it a text cell with empty text or mark it as an empty cell with no value. \*/ 

### 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 |  |
| First row | The first row to process. First row has index 0. | 3 |  |
| Last row | The last row to process. First row has index 0. | 6 |  |
| First column | The first column to process. First column has index 0. | 2 |  |
| Last column | The last column to process. First column has index 0. | 4 |  |
| Values | The values to use.   Can be separated with row and column delimiter to give each row and column a different value.   But you can also use same value for all rows or for all columns. | "Test" |  |
| Row Delimiter | The row delimiter for the result.   Default is new line character. | "¶" | Optional |
| Column Delimiter | The column delimiter for the result.   Default is tab character. | char(9) | Optional |
| DoBlanksForEmptyText | Whether to write blank cells.   If you pass an empty value for a cell, we can either make it a text cell with empty text or mark it as an empty cell with no value. |  | Optional      Added in version **15.0**. |

### Result

Returns number of errors or error.

### Description

Writes texts to an area of cells.  
You can write one value or multiple values to a given range of cells.  
Returns number of errors occurred, so on success you get back zero.  
### Examples

Write 4 cells in one call

 MBS ( "XL.Sheet.CellWriteTexts"; $book ; $sheet ; 1; 1; 1; 4; "A,B,C,D"; ¶; "," )  
Write bold row and data rows:

 # create bold font &amp; format   
Set Variable \[ $boldFont ; Value: MBS ( "[XL.Book.AddFont](XLBookAddFont.md)"; $bookRef ) \]   
Set Variable \[ $r ; Value: MBS ( "[XL.Font.SetBold](XLFontSetBold.md)"; $bookRef ; $boldFont ; 1) \]   
Set Variable \[ $boldFormat ; Value: MBS ( "[XL.Book.AddFormat](XLBookAddFormat.md)"; $bookRef ) \]   
Set Variable \[ $r ; Value: MBS ( "[XL.Format.SetFont](XLFormatSetFont.md)"; $bookRef ; $boldFormat ; $boldFont ) \]   
\# Write a title row   
Set Variable \[ $r ; Value: MBS ( "XL.Sheet.CellWriteTexts"; $bookRef ; $sheet ; 1; 1; 1; 4; "A,B,C,D"; ¶; "," ) \]   
\# Make it bold   
Set Variable \[ $r ; Value: MBS ( "[XL.Sheet.SetCellFormats](XLSheetSetCellFormats.md)"; $bookRef ; $sheet ; 1; 1; 1; 4; $boldFormat ) \]   
\# and write data   
Set Variable \[ $r ; Value: MBS ( "XL.Sheet.CellWriteTexts"; $bookRef ; $sheet ; 2; 5; 1; 4; $data ; ¶; "," ) \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Font.SetBold](XLFontSetBold.md)
- [XL.Sheet.CellWriteComment](XLSheetCellWriteComment.md)
- [XL.Sheet.CellWriteDate](XLSheetCellWriteDate.md)
- [XL.Sheet.CellWriteDates](XLSheetCellWriteDates.md)
- [XL.Sheet.CellWriteError](XLSheetCellWriteError.md)
- [XL.Sheet.CellWriteMatrix](XLSheetCellWriteMatrix.md)
- [XL.Sheet.CellWriteText](XLSheetCellWriteText.md)
- [XL.Sheet.SetCellFormat](XLSheetSetCellFormat.md)
- [XL.Sheet.SetCellFormats](XLSheetSetCellFormats.md)

### Release notes

- **Version 15.0**
    - Added DoBlanksForEmptyText parameter to [XL.Sheet.CellWriteTexts](https://www.mbsplugins.eu/XLSheetCellWriteTexts.shtml) function.
- **Version 9.1**
    - Fixed a problem with [XL.Sheet.CellWriteTexts](http://www.mbsplugins.eu/XLSheetCellWriteTexts.shtml) function and empty entries in value list.
- **Version 8.0**
    - Added [XL.Sheet.CellReadBooleans](http://www.mbsplugins.eu/XLSheetCellReadBooleans.shtml), [XL.Sheet.CellReadComments](http://www.mbsplugins.eu/XLSheetCellReadComments.shtml), [XL.Sheet.CellReadDates](http://www.mbsplugins.eu/XLSheetCellReadDates.shtml), [XL.Sheet.CellReadFormulas](http://www.mbsplugins.eu/XLSheetCellReadFormulas.shtml), [XL.Sheet.CellReadNumbers](http://www.mbsplugins.eu/XLSheetCellReadNumbers.shtml), [XL.Sheet.CellReadTexts](http://www.mbsplugins.eu/XLSheetCellReadTexts.shtml), [XL.Sheet.CellWriteBlanks](http://www.mbsplugins.eu/XLSheetCellWriteBlanks.shtml), [XL.Sheet.CellWriteBooleans](http://www.mbsplugins.eu/XLSheetCellWriteBooleans.shtml), [XL.Sheet.CellWriteComments](http://www.mbsplugins.eu/XLSheetCellWriteComments.shtml), [XL.Sheet.CellWriteDates](http://www.mbsplugins.eu/XLSheetCellWriteDates.shtml), [XL.Sheet.CellWriteFormulas](http://www.mbsplugins.eu/XLSheetCellWriteFormulas.shtml), [XL.Sheet.CellWriteNumbers](http://www.mbsplugins.eu/XLSheetCellWriteNumbers.shtml), [XL.Sheet.CellWriteTexts](http://www.mbsplugins.eu/XLSheetCellWriteTexts.shtml), [XL.Sheet.GetCellErrors](http://www.mbsplugins.eu/XLSheetGetCellErrors.shtml), [XL.Sheet.GetCellFormats](http://www.mbsplugins.eu/XLSheetGetCellFormats.shtml), [XL.Sheet.RemoveComments](http://www.mbsplugins.eu/XLSheetRemoveComments.shtml) and [XL.Sheet.SetCellFormats](http://www.mbsplugins.eu/XLSheetSetCellFormats.shtml).

### Blog Entries

- [Neues MBS Plugin 15.0 für Claris FileMaker](https://www.mbsplugins.de/archive/2025-01-14/Neues_MBS_Plugin_150_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 15.0 for Claris FileMaker](https://www.mbsplugins.de/archive/2025-01-14/MBS_Plugin_150_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.0pr8](https://www.mbsplugins.de/archive/2025-01-07/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [LibXL for FileMaker with extras](https://www.mbsplugins.de/archive/2021-03-02/LibXL_for_FileMaker_with_extra/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr3](https://www.mbsplugins.de/archive/2019-02-18/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.0pr8](https://www.mbsplugins.de/archive/2018-01-15/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

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

This function checks for a license.

Created 15th January 2018 , last changed 4th January 2025

  
[XL.Sheet.CellWriteTextAsNumber](XLSheetCellWriteTextAsNumber.md) - [XL.Sheet.Clear](XLSheetClear.md)

[HTML Version](XLSheetCellWriteTexts.shtml)