Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XL.Sheet.CellReadText

Reads a text value from a cell.

Component Version macOS Windows Linux Server iOS SDK
XL 3.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Sheet.CellReadText"; BookRef; SheetIndex; Row; Column )   More

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-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"; $bookRef; $sheet) ]
Loop [ Flush: Defer ]
    Set Variable [ $text ; Value: MBS( "XL.Sheet.CellReadText"; $bookRef; $sheet; $row; 2 ) ]
    If [ Position ( $text ; $textToFind ; 1 ; 1 ) > 0 ]
        Set Variable [ $foundRow ; Value: $row ]
        Exit Loop If [ 1 ]
    End If
    #
    Set Variable [ $row ; Value: $row + 1 ]
    Exit Loop If [ $row > $lastRow ]
End Loop
#
Set Field [ XL::Text ; "found in row: " & $foundRow ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

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


XL.Sheet.CellReadStyledText - XL.Sheet.CellReadTexts