[英]excel lookup returning reference
Excel has a "lookup" function that finds a specified value in a row or column and returns a corresponding value from another column. Excel 有一个“查找”功能,可以在行或列中查找指定的值,并从另一列返回相应的值。
But is there a lookup that returns the reference of the found cell?但是是否有一个查找可以返回找到的单元格的引用? I have a case where I have a column of dates, and I want to search the list for a given date and then return the reference -- A23 or whatever -- of that cell.我有一个案例,我有一列日期,我想在列表中搜索给定日期,然后返回该单元格的引用 - A23 或其他任何内容。
Can also be done using formula's only.也可以仅使用公式来完成。
eg Search range A1:A10 for value in B1, return address例如在 B1 中搜索范围 A1:A10 的值,返回地址
=CELL("address",OFFSET($A$1,MATCH(B1,$A$1:$A$10),0))
I believe you're looking for the Find method in VBA?我相信您正在寻找 VBA 中的 Find 方法?
.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
http://msdn.microsoft.com/en-us/library/aa195730(office.11).aspx http://msdn.microsoft.com/en-us/library/aa195730(office.11).aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.