If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > automating record search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-11, 15:53
OCM OCM is offline
Registered User
 
Join Date: Sep 2002
Location: USA
Posts: 63
automating record search

Greetings,

Following is what I would like to automate:

Take a record from Workbook #1 column D and search if this record exists in Workbook #2 Column P.

If the record exists, then take the corresponding record from Column W in the same Workbook (workbook #2) and copy the record in Workbook #1 column H. If no match, then column H will be filled with n/a.

Thank you in advance,

OCM
Reply With Quote
  #2 (permalink)  
Old 08-05-11, 09:40
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hello,

A VLOOKUP() formula will do this. If you need to automate with VBA then use VBA to put formulae into the workbook, calculate, and then convert to values.
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #3 (permalink)  
Old 08-05-11, 16:42
OCM OCM is offline
Registered User
 
Join Date: Sep 2002
Location: USA
Posts: 63
Smile automating record search

Thanks for your reply Colin,

Following is what I tried:

=VLOOKUP(D3,'[Workbook2.xlsx]Sheet1'!$P$2:$W$400,8,FALSE)

=Vlookup(D3,'[Workbook2.xlsx]Sheet1'!P:W,8,FALSE)

I was getting #N/A, and when a record exists, for some reason, the cell is filled w 0 when there is a match.


Thanks,

OCM
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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