Merging two excel sheets

[Closed]
Report
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013
-
Posts
2806
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 20, 2021
-
Hello guys im totally new here and i want to ask a question.
I have two excel sheets that i want to merge. Let me explain what i want to do and i hope u understand.
Both of them have one column let say column C the same.
I want a macro that checks column C identifies the same numbers that i have written in column C on both sheets and then to copy from the second sheet everything that is written in Column D and E to sheet 1 next to Column C.

Example

Sheet 1:
Column C

4002919-6
4002515-8
7215444-6
7235445-7

Sheet 2:
Column C Column D

4002510-6 TEST1
4002515-8 Test2
7216455-8 Test3
7215444-6 Test4

I want to find the same numbers from Column C and then to sheet 1 to copy the contents of Column D. Whenever there is no match field to leave Column D in Sheet 1 empty.

I hope u understand what i mean.

Thanx a lot

8 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
you can use vlookup
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013

i tried but it gives me error all the time
anybody can help me?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
try some thing like this
=VLOOKUP(C1,Sheet2!C:E, 2, FALSE)
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013

Again gives me error.
I went to column D i paste this and the error is this #NAME?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
see this to see if it helps in resolving your error
http://office.microsoft.com/en-us/excel-help/correct-a-name-error-HP010342326.aspx
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013

i read this already and i also read some other topics here that they tell about vlookup but didnt help. Is it possible to send u the file and check it for me please?
Thanx
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
you can upload the file at some file share site like speedyshare etc and post back the link to the FILE itself back here
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013

hell my friend and thanx for helping me
the link is http://speedy.sh/HxmrK/FILE2.xlsx
thanx a lot in advance
Posts
2806
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 20, 2021
482
Hi Savgeorg,

To keep the cell empty when there isn't a match I added the ISERROR function to the formula of Rizvisa:

http://speedy.sh/e6Ska/Savgeorg-FILE2.xlsx

Best regards,
Trowa
Posts
6
Registration date
Friday November 1, 2013
Status
Member
Last seen
November 5, 2013

Thanx Trowa this is exactly what i want :)
One last question. If i want to add all the columns after Column C not just Column D what i should write on your formula?
Posts
2806
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 20, 2021
482
Hi Savgeorg,

You mean like this?:
http://speedy.sh/Fwjde/Savgeorg-FILE2-V2.xlsx

Best regards,
Trowa