Paste unique value

Hello everyone i have two excel file and i need to compare those two excel sheet column data and pick unique value from the Sheet one and paste that value in the sheet2 column data . For example -

Sheet1 -

Col2
12
15
16
2

Sheet2

Col2
12
15

Updated Sheet2

Col2
12
15
16
2

Any suggestions @Yoichi @ashokkarale @mkankatala my main focus is to pick unique value and add in sheet2

Hi @Darkfighter

Can you please explain how the comparison should happen in sheet1 and sheet2

Hi @Darkfighter

How would you define “unique value”?

I’ve looked at the problem many many times and I couldn’t understand what is supposed to happen.
This is what I see:
Sheet1 - Col3 becomes Sheet2 - Col1
and
Sheet1 - Col2 becomes Sheet2 - Col2

Did I miss anything?

Okay so I’m pasting the columns

Sheet1 -

Col2
12
15
16
2

Sheet2

Col2
12
15

Updated Sheet2

Col2
12
15
16
2

@Darkfighter ,
basically sheet1-col2 = sheet2-col2 , without any value repeating?

@Darkfighter

Isnt it same as the first excel already?

If so just copy whole sheet and paste

Cheers

No basically both sheet had different columns names thats why can’t do copy paste logic.

@Darkfighter

You can read range and paste the data without pasting the headers as well

Cheers

@Darkfighter

When the values are same how does it make a difference if you check or not…you need not append the data…you can overwrite whole data so that if value is present or not it is over written any ways

Is there a posibility that there might be a value in sheet2 which is not there is sheet1 as well?

If so then use the below query to get unique from sheet1

Dt1 = dt1.AsEnumerable.Where(function(x) Not dt2.AsEnumerable.Any(function(y) y(0).ToString.Equals(x(0).ToString))).CopyToDatatable

Cheers

Still not working … can you suggest any other options

@Darkfighter

image

image

dt2 result:

image

@Darkfighter

Please show how you implemented and what is not working then we can help

Cheers