Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
look up
Hello all,
I need some help with something similar to a vlookup. The books I am searching in are different all the time. I would like to identify my value in the main workbook and look in the other books to find a duplicate. When I find the value I need to return the value of a cell three columns over. I can identify the workbook and worksheet, but I cannot gety it to work in a vlookup formula. My "junior programer" solution would be to go to the column in the worksheet and go down one row at a time (loop) until I found the value. I know there is a more efficient way. thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
look up
Dim rng as Range
With Workbooks("Otherbook").worksheets("Sheet1") set rng = .Columns(3).Find(searchstring) End with if not rng is nothing then msgbox "found - value to return is " & rng.offset(0,3).Value Else msgbox "Not found" End if Look in help at the find method of the range object. It has other arguments that may affect how it searches and what it finds. (this command corresponds to doing Edit=Find -- Regards, Tom Ogilvy "Tim" wrote in message ... Hello all, I need some help with something similar to a vlookup. The books I am searching in are different all the time. I would like to identify my value in the main workbook and look in the other books to find a duplicate. When I find the value I need to return the value of a cell three columns over. I can identify the workbook and worksheet, but I cannot gety it to work in a vlookup formula. My "junior programer" solution would be to go to the column in the worksheet and go down one row at a time (loop) until I found the value. I know there is a more efficient way. thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|