VBA Code for Compare two columns and extract unique values

mralby

New Member
Joined
Oct 30, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have two distinctive columns, COLUMN A (Customer List 1) & COLUMN D (Main Customer List)
Whenever I added a new entry in COLUMN A, run VBA script (Macro) to extract unique values from COLUMN A and add to the last empty cell to the COLUMN D?

Below is the image.

Screenshot 2022-11-12 210142.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Power Query.

Enter any new data in Column A. On the Data Tab, click Refresh All and Data will update in Column D. When you Close and Load, Select D1 as the destination

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Customer List1"}, {{"Master Customer List", each _, type table [Customer List1=number]}}),
    #"Removed Columns" = Table.RemoveColumns(#"Grouped Rows",{"Master Customer List"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Customer List1", "Master Customer List"}})
in
    #"Renamed Columns"
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,830
Members
449,096
Latest member
Erald

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