ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   look up (https://www.excelbanter.com/excel-programming/311335-look-up.html)

tim

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.

Tom Ogilvy

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.





All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com