Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > FindFirst Method : FindFirst(String,ExcelFindType,ExcelFindOptions) Method
Value to search.
Type of value to search.
Way to search the value.

FindFirst(String,ExcelFindType,ExcelFindOptions) Method

Returns the first occurrence of the specified string value with the specified ExcelFindType and ExcelFindOptions.
Syntax
'Declaration
 
Overloads Function FindFirst( _
   ByVal findValue As String, _
   ByVal flags As ExcelFindType, _
   ByVal findOptions As ExcelFindOptions _
) As IRange
'Usage
 
Dim instance As IWorksheet
Dim findValue As String
Dim flags As ExcelFindType
Dim findOptions As ExcelFindOptions
Dim value As IRange
 
value = instance.FindFirst(findValue, flags, findOptions)

Parameters

findValue
Value to search.
flags
Type of value to search.
findOptions
Way to search the value.

Return Value

Returns the first cell with a specified string value and specified find options , or null if value was not found.
Example
The following code illustrates how to find the first occurrence of the specified string value with specified Excel find option.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
            
//Find First with string and specified find option.
IRange results = sheet.FindFirst("Hello World", ExcelFindType.Text,ExcelFindOptions.MatchCase);
            
string fileName = "Find.xlsx";
workbook.SaveAs(fileName);
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also