How to find row number in worksheet based on search string in c#.net

  • Thread starter Thread starter Gani tpt
  • Start date Start date
G

Gani tpt

Guest
I am searching some string in the excel worksheet column. This is working perfect.

But, i want to get the row number of the search string in the worksheet...?


string colToCheck = "C40:C90"
string SearchNo = "ABC-201";
Excel.Range resultRange;
colRange = XLWorkSheet1.Range[colToCheck];//get the range object where you want to search from

resultRange = colRange.Find(

What: SearchNo,

LookIn: Excel.XlFindLookIn.xlValues,

LookAt: Excel.XlLookAt.xlPart,

SearchOrder: Excel.XlSearchOrder.xlByRows,

SearchDirection: Excel.XlSearchDirection.xlNext

);
1377005.png

Continue reading...
 
Back
Top