Hi there, i hope someone can help me?
How do I insert data from another worksheet, based on criteria in the current one?
for instance- worksheet A has 2 columns: "name" and "code" Each name in the "name" column is unique, and has its own code:
Ann, 001
Ben, 002
Claire, 003
In worksheet B I have only the names, but many duplicates. how do i insert, in a seperate column, the code of the name of worksheet A?
so, if the names in worksheet B look like this:
Ann
Ann
Ben
Claire
Ann
The code that is inserted into the row next to the names must be the same code that the names have in worksheet A. Each "Ann" should have the code 001 next to it- for instance.
Many thanks!![]()
Open both workbooks.
On workbook B in cell B2, to get the code matching A2 from the other sheet, put in this formula:
=VLOOKUP(A4,'[Workbook A.xls]Sheet1'!$A:$B, 2, 0)
Once the correct value appears in B2, copy that cell downward through the whole data set.
Close Workbook A.
The formulas in Workbook B just expanded themselves to include the full path to Workbook A, so it will keep working even with the workbook closed.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks