SpreadsheetDocument.FindText

Syntax:

FindText(<Line>, <Beginning>, <Where>, <SearchByRows>, <EntireCell>, <SearchForward>, <IgnoreCase>)

Parameters:

<Line> (required)

Type: String.
Required text.

<Beginning> (optional)

Type: SpreadsheetDocumentRange.
The area after which the search is executed. If this parameter is not specified, search will be performed from the beginning of the spreadsheet document.

<Where> (optional)

Type: SpreadsheetDocumentRange.
The area where the search is executed. If this parameter is not specified, search is performed in all cells of the spreadsheet document.

<SearchByRows> (optional)

Type: Boolean.
Defines cells tab order by search.
True - search in current row, then go to the next, etc., in the general search direction, False - search in current column, then go to the next, etc., in the general search direction.
Default value: True.

<EntireCell> (optional)

Type: Boolean.
True - search only those cells where whole cell text is the same as required text, False - search part of cell text.
Default value: False.

<SearchForward> (optional)

Type: Boolean.
You can use it to define search direction: True - search forward; False - search backward.
Default value: True.

<IgnoreCase> (optional)

Type: Boolean.
True - don't match case, False - match case by search.
Default value: False.

Returned value:

Type: SpreadsheetDocumentRange; SpreadsheetDocumentDrawing.
The area that contains a searched text. If the text is not found, Undefined value is returned.

Description:

Searches for text in spreadsheet document cells.

Availability:

Thin client, web-client, server, thick client, external connection, Mobile application (client), Mobile application (server).

Example:

// To look how this method works, add the following lines
// to the end of the example for the StartRowGroup() method
Department = "Total2";
Area=Spreadsheet.FindText(Department);
If 
TypeOf(Area)=Type("Undefined") Then
    Message("Value not found!");
Else
    Pos = Find(Area.Name,"C");
    Name= Left(Area.Name,Pos)+
        String(Number(Right(Area.Name,StrLen(Area.Name)-Pos))+1); 
    Message("Total on department 2 = "+Spreadsheet.Area(Name).Text);
EndIf
;


    

1C:Enterprise Developer's Community