#1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"