DIAdem Help

Method: Find for Worksheet

  • Updated2024-09-12
  • 2 minute(s) read

Method: Find for Worksheet

Searches for the cell that fulfills the search conditions. If the search conditions are not met, the method returns Nothing.

Set oCell = Object.Find(Text, [Comparison], [Row], [Column], [SearchOrder], [MatchCase])
ObjectWorksheet
Object with this method
TextString
Specifies the text.
[Comparison]Enumeration with read access and the following selection terms:
 0
eExcelSearchEquals 
The text of the cell corresponds to the search text.
 1
eExcelSearchStartsWith 
The text of the cell begins with the search text.
 2
eExcelSearchContains 
The text of the cell contains the search text. (Default value)
[Row]LongInteger
Specifies the row after which the search starts. The default value is 0.
[Column]LongInteger
Specifies the column after which the search starts. The default value is 0.
[SearchOrder]Enumeration with read access and the following selection terms:
 0
eExcelSearchByRows 
Searches the text row by row. (Default value)
 1
eExcelSearchByColumns 
Searches the text column by column.
[MatchCase]Boolean
Specifies whether DIAdem REPORT includes the worksheet when printing (TRUE) or not (FALSE). The default value is FALSE.
oCellCell
Returned object

The following example creates an Excel workbook, fills a cell with the value "Start of Data", searches in the worksheet for the value Data, and outputs the row below the found value. Refer to the help page Worksheet for detailed examples:

VBScriptPython

 

Dim iRow, iData, jCol, oMyWorkbook, oMySheet, oMyCell
Set oMyWorkbook = CreateExcelWorkbook()
Set oMySheet = oMyWorkbook.Worksheets(1)
oMySheet.Cells(5, 1).Value = "Start of Data"
Set oMyCell = oMySheet.Find("Data", eExcelSearchContains)
iData = oMyCell.Row + 1
Call MsgBox(iData)