简体   繁体   中英

Finding Data in Excel Spreadsheet

Hello is there anyway that I can search my Excel Document in a certain column for an existing data?, and if the data does exist can I have my code execute something different. I have looked into it quite a bit and found nothing of great use. This was one of the site I have checked out. http://msdn.microsoft.com/en-us/library/e4x1k99a(v=vs.80).aspx . I found this below, but don't know if there is a way I can use this as an if statement. Any help is greatly appreciated. Thanks

currentFind = this.Fruits.Find("apples", missing,
Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, 
Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, false,
missing, missing); 

What about

if (currentFind == null)
{
// Do this if nothing found...
}
else
{
// Do this if something found...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM