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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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