First Time Macro

  • Thread starter Thread starter Greensearch
  • Start date Start date
G

Greensearch

I am seeking assistance in creating a macro for the first time. I have two
Excel files (File1 and File2). Column "R" in File1 is formated as text
numbers. When I type in a value (e.g. "015") I would like a command in File1
that says, "go to File2, Column A, Row 1 to find a match. If no match go to
Row 2, Row 3 etc. until it finds a match. When it does find a match, pick up
what is in that Row/Column F File2 and put it into File1, Column "S", the
same Row I was in when I typed the "015" in Column "R".

It's basic "look-up", but I've no idea how to write it; type (e.e. 015) in
the first file, go to the second file, find a match and pick up the data in
the corresponding cell and copy it into the specified cell in first file.
 
Open File2... assuming lookup range is A:B in Sheet1

Enter this formula in S1 of File1
=VLOOKUP(R1,[File2.xls]Sheet1!$A:$B,2,FALSE)

If you close File2 its complete path will be added by Excel before its name.
 
Open File2... assuming lookup range is A:B in Sheet1

Enter this formula in S1 of File1
=VLOOKUP(R1,[File2.xls]Sheet1!$A:$B,2,FALSE)

If you close File2 its complete path will be added by Excel before its name.
 
Back
Top