Macro to copy row into Sheet 2 based on the Unique Identifiers

Hi All,
Need some help in coming up with a Macro. I have two excel spreadsheet. Both have Employee ID and Values in column A and B respectively. Spreadsheet 1 has columns A to G populated but Spreadsheet 2 has only A and B populated. I wanted columns C to G to be populated in spreadsheet 2 if A and B columns matches with the spreadsheet 1. Also, Column A can have same employee ID getting repeated. I got it to work using vlookup  but not that great in Macros.

Any help would be greatly appreciated.

Thanks,
Ashish
Milind AgarwalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saurabh Singh TeotiaCommented:
Ashish,

Can you upload your sample file here as it becomes easy to write a macro for you to do what you are looking for...

Saurabh...
0
Milind AgarwalAuthor Commented:
Hi Saurabh,
Please find the sample attached. Want to get the rest of the column populated in sheet2 from sheet1 based on unique identifiers in column a and b.

Thanks,
Milind
Sample.xlsx
0
Saurabh Singh TeotiaCommented:
Is their any particular reason you are looking for a macro solution as you can do it easily with formula..Like this..

Let me know if you need a macro solution only then will write a macro for you to do what you are looking for..

Saurabh...
Sample.xlsx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Milind AgarwalAuthor Commented:
Hey,
Well I used Vlookup concatenating the values in col A and B. But Vlookup has its limitations. Some times I get N/A at times 0 sometimes DIV/0!. I see u have used iferror to avoid space issue. I feel if we could have another alternative at my disposal since this is kind of a repetitive work.

Thanks,
Ashish
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.