简体   繁体   English

在Excel电子表格中查找数据

[英]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. 您好,无论如何,我可以在某个列中的Excel文档中搜索现有数据吗?如果数据确实存在,我可以让我的代码执行不同的操作。 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 . http://msdn.microsoft.com/zh-CN/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. 我在下面找到了这个,但是不知道是否有一种方法可以将其用作if语句。 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...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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