如何迭代Excel工作表的第一列搜索给定值 [英] How do I iterate down the first column of an Excel sheet searching for a given value

查看:96
本文介绍了如何迭代Excel工作表的第一列搜索给定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用互操作Excel。 。我打开的文件在第一列输入了50个状态(2个字母缩写)。相邻的列具有与该状态相关的各种地址。



我一直试图在第一列的内容中找到一些帮助。 。搜索特定状态(给定)然后获取行号以便能够访问属于该州的相关地址。



提前感谢任何建议。

I have been working with interop Excel . . the file I have opened has the 50 states entered in the first column (2 letter abbreviation). The adjacent columns have various addresses relevant to that state.

I have been trying to find some help in interating the first column . . searching for a particular state (given) & then obtain the row number to be able to access the related addresses belonging to that state.

Thanks in advance for any suggestions.

推荐答案

您是否尝试过 Range.Find - http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.range.find .ASPX [ ^ ]。



也试试 - 以编程方式搜索工作表范围中的文本 [ ^ ]
Did you try Range.Find - http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.range.find.ASPX[^].

Also try - Programmatically Search for Text in Worksheet Ranges[^]


这篇关于如何迭代Excel工作表的第一列搜索给定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆