XL.Sheet.CellReadText
---------------------

Reads a text value from a cell.

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

MBS( "XL.Sheet.CellReadText"; BookRef; SheetIndex; Row; Column ) 

**MBS**( **"XL.Sheet.CellReadText";** /\* Reads a text value from 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. \*/ 

### 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 |
| Row | The row for the cell. First row has index 0. | $row |
| Column | The column for the cell. First column has index 0. | $column |

### Result

Returns text or error message.

### Description

Reads a text value from a cell.  
### Examples

Reads text from first cell in first sheet:

 MBS ( "XL.Sheet.CellReadText"; $book ; $sheet ; 0; 0 )  
Find row containing a text:

 Set Variable \[ $sheet ; Value: 0 \]  
Set Variable \[ $textToFind ; Value: "Tablespoon" \]  
Set Variable \[ $row ; Value: 0 \]  
Set Variable \[ $foundRow ; Value: "" \]  
Set Variable \[ $lastRow ; Value: MBS ("[XL.Sheet.GetLastRow](XLSheetGetLastRow.md)"; $bookRef ; $sheet ) \]  
Loop \[ Flush: Defer \]  
 Set Variable \[ $text ; Value: MBS ( "XL.Sheet.CellReadText"; $bookRef ; $sheet ; $row ; 2 ) \]  
 If \[ Position ( $text ; $textToFind ; 1 ; 1 ) &gt; 0 \]  
 Set Variable \[ $foundRow ; Value: $row \]  
 Exit Loop If \[ 1 \]  
 End If  
 #   
 Set Variable \[ $row ; Value: $row + 1 \]  
 Exit Loop If \[ $row &gt; $lastRow \]  
End Loop  
\#   
Set Field \[ XL::Text ; "found in row: " &amp; $foundRow \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.CellReadDate](XLSheetCellReadDate.md)
- [XL.Sheet.CellReadDates](XLSheetCellReadDates.md)
- [XL.Sheet.CellReadNumber](XLSheetCellReadNumber.md)
- [XL.Sheet.CellReadStyledText](XLSheetCellReadStyledText.md)
- [XL.Sheet.CellReadTexts](XLSheetCellReadTexts.md)
- [XL.Sheet.CellReadValue](XLSheetCellReadValue.md)
- [XL.Sheet.CellReadValues](XLSheetCellReadValues.md)
- [XL.Sheet.CellWriteText](XLSheetCellWriteText.md)
- [XL.Sheet.CellWriteTexts](XLSheetCellWriteTexts.md)

### Release notes

- **Version 13.5**
    - Changed [XL.Sheet.CellReadStyledText](https://www.mbsplugins.eu/XLSheetCellReadStyledText.shtml) function to fall back to [XL.Sheet.CellReadText](https://www.mbsplugins.eu/XLSheetCellReadText.shtml) for non styled cells.
- **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).

### Example Databases

- [XL/XL Import and Export](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/XL%20Import%20and%20Export.shtml#7ScriptAnchor_)

### Blog Entries

- [LibXL 5.2 released](https://www.mbsplugins.de/archive/2026-06-13/LibXL_52_released/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 13 - XL](https://www.mbsplugins.de/archive/2023-12-13/MBS_Plugin_Advent_calendar_13_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.5pr1](https://www.mbsplugins.de/archive/2023-09-26/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 27th May 2026

  
[XL.Sheet.CellReadStyledText](XLSheetCellReadStyledText.md) - [XL.Sheet.CellReadTexts](XLSheetCellReadTexts.md)

[HTML Version](XLSheetCellReadText.shtml)