Method: Find for Worksheet
- Updated2024-09-12
- 2 minute(s) read
Methods > Method: Find for Worksheet
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])
| Object | Worksheet Object with this method | |||||||||
| Text | String Specifies the text. | |||||||||
| [Comparison] | Enumeration with read access and the following selection terms:
| |||||||||
| [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:
| |||||||||
| [MatchCase] | Boolean Specifies whether DIAdem REPORT includes the worksheet when printing (TRUE) or not (FALSE). The default value is FALSE. | |||||||||
| oCell | Cell 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:
| VBScript | Python |
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)