![]() |
Remove duplicates found in master list
Hey guys!
I have 2 columns of data. In column A is my master list of names and in column B is a list of names that I would like to compare against my master list in column A. If the name is found in column B that exists in column A, remove the name from column B. Can this done in excel? Thanks!! Mike |
Remove duplicates found in master list
Mike
This macro should do what you want. HTH Otto Sub RemoveDups() Dim RngB As Range Dim RngA As Range Dim i As Range Set RngA = Range("A1", Range("A" & Rows.Count).End(xlUp)) Set RngB = Range("B1", Range("B" & Rows.Count).End(xlUp)) For Each i In RngB If Not RngA.Find(What:=i.Value, Lookat:=xlWhole) Is Nothing Then _ i.Delete Shift:=xlUp Next i End Sub "Mike" wrote in message ... Hey guys! I have 2 columns of data. In column A is my master list of names and in column B is a list of names that I would like to compare against my master list in column A. If the name is found in column B that exists in column A, remove the name from column B. Can this done in excel? Thanks!! Mike |
Remove duplicates found in master list
Yup! Perfect! Thanks Otto!
"Otto Moehrbach" wrote: Mike This macro should do what you want. HTH Otto Sub RemoveDups() Dim RngB As Range Dim RngA As Range Dim i As Range Set RngA = Range("A1", Range("A" & Rows.Count).End(xlUp)) Set RngB = Range("B1", Range("B" & Rows.Count).End(xlUp)) For Each i In RngB If Not RngA.Find(What:=i.Value, Lookat:=xlWhole) Is Nothing Then _ i.Delete Shift:=xlUp Next i End Sub "Mike" wrote in message ... Hey guys! I have 2 columns of data. In column A is my master list of names and in column B is a list of names that I would like to compare against my master list in column A. If the name is found in column B that exists in column A, remove the name from column B. Can this done in excel? Thanks!! Mike |
All times are GMT +1. The time now is 11:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com