compare and Extract unique values between 2 columns

TroyB

New Member
Joined
Nov 12, 2019
Messages
18
Hello All

I am trying to create a macro that will Compare data in two columns (on two sheets (sheet1 Column B, sheet2 Column A) and add any missing unique values from sheet 1 to sheet 2


Sheet1 column B

Items#s

Item 1
Item 2
Item 1
Item 4
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6


Sheet2 Column A

Item#s
Item 1
Item 2
Item 4
Item 3
Item 5

After Running Item 6 would be added to the last row of sheet2 Column A



Can you please Help??

Troy
 
Hi Fluff,

Each time I run your code it adds duplicate values to Column A on sheet2.

I am unsure why but it is bringing in items from Column B that have data in the Adjacent cell (Column C)
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Oops, misread your post, it should be
Rich (BB code):
If Cl.Value <> "" And Cl.Offset(, 1).Value ="" Then Dic.Item(Cl.Value) = Empty
 
Upvote 0
Hi Fluff,

Each time I run your code it adds duplicate values to Column A on sheet2.

I am unsure why but it is bringing in items from Column B that have data in the Adjacent cell (Column C)

You tested my code in post #9, consider the cell in column C = ""
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,947
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top