Say I have two spreadsheets.
One of the spreadsheets has a table like this:
**Sheet 1**
A B C D
1 Name Age Rank Number
2 George 22 Master 12
3 Paul 21 Acolyte 22
4 Jimmy 32 Horse 33
5 Agnor 12 Cheetah 90
The other spreadsheet looks like this:
**Sheet 2**
A B C D
1 Name Age Rank Number
2 George
3 Paul 21 22
4 Agnor
I want to copy Ages from sheet 1 to sheet 2. So I would copy George, Paul, and Agnor's age, and ignore Jimmy. Which function should I use to copy data based on an existing value?
Is there something like:
foreach VAL in Sheet1
if(Sheet1.Name.EqualsIgnoreCase(Sheet2.Name))
{
Sheet2.Age = Sheet1.Age;
}
I looked this up, and a lot of people are saying to use VLookup, but I can't figure out how that would apply.
EDIT
I found a similar resolved question (No idea HOW I missed it) here: Compare and copy data between worksheets
However, I'm still a little shaky on how to implement this (I'm using Excel 2007).