VBA - Lookup cell address

G

Guest

Is there a way to get vlookup to return the address
instead of the value of a cell. I can do this w/o VBA
using the function

=CELL("address",INDEX(C71:D74,MATCH("b",C71:C74),2))

but the CELL function is not in the WorksheetFunction
object. Thanks in advance for any help with this.
 
T

Tom Ogilvy

Dim rng as Range, res as variant
rng = Range("C71:C74")
res = application.Match("b",rng,0)
if not iserror(res) then
msgbox Range("D71:D74")(res).Address
else
msgbox "not found"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top