excel lookup returning reference
Excel has a "lookup" function that finds a specified value in a row or column and returns a correspondi开发者_开发问答ng value from another column.
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.
Can also be done using formula's only.
eg Search range A1:A10 for value in B1, return address
=CELL("address",OFFSET($A$1,MATCH(B1,$A$1:$A$10),0))
I believe you're looking for the Find method in VBA?
.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
http://msdn.microsoft.com/en-us/library/aa195730(office.11).aspx
精彩评论