Delete duplicate ID if name does not match

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
157
Hi Can someone please help on this. I have two data set in sheet1 & sheet2. from sheet2 it should pick the ID and matches in sheet1. i have to check if first name of company match with remaining ID name if any of the ID does not have same name then delete All the row for that ID from sheet2. hope it make sense.

sheet1
[TABLE="width: 247"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]787a00390[/TD]
[TD]AYECGAYTY UMDERYRGTERA YYC[/TD]
[/TR]
[TR]
[TD]787a00390[/TD]
[TD]AYECGAYTY UMDERYRGTERA, YYC[/TD]
[/TR]
[TR]
[TD]72a070872[/TD]
[TD]AVGAYY AERVGCEA GMC[/TD]
[/TR]
[TR]
[TD]72a070872[/TD]
[TD]AVGAYY AERVGCEA GMC[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM #8390-GMDUATRGAY HUB[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM-BROKEM ARROY #8895[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM EMTERYRGAEA[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM EMTERYRGAEA GMC[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM EMTERYRGAEA GMC[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OerguAoM EMterYrGAeA GMc.[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]OERGUAOM EMTERYRGAEA, GMC.[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]YOYAEYEY GMDUATRGAY GRY[/TD]
[/TR]
[TR]
[TD]72a25a783[/TD]
[TD]YOYAEYEY GMDUATRGAY GROUY[/TD]
[/TR]
[TR]
[TD]72a02832a[/TD]
[TD]AOUTHERM YOYER COMYAMY[/TD]
[/TR]
[TR]
[TD]72a02832a[/TD]
[TD]AoutherM YoYer ComYaMy[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]ARGZOMA AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]GYYGMOGA AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]GOYA AMERGCAM YATER CO[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]MEY JERAEY AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]MEY JERAEY AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]TEMMEAAEE AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]TEMMEAAEE AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]YEAT VGRGGMGA AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="align: right"]720772893[/TD]
[TD]YEAT VGRGGMGA AM YATER CO


[/TD]
[/TR]
</tbody>[/TABLE]
sheet2
[TABLE="width: 128"]
<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]ID[/TD]
[TD="width: 64"]Name[/TD]
[/TR]
[TR]
[TD="class: xl65"]787a00390[/TD]
[TD="class: xl65"]AYECGAYTY UMDERYRGTERA YYC[/TD]
[/TR]
[TR]
[TD="class: xl65"]787a00390[/TD]
[TD="class: xl65"]AYECGAYTY UMDERYRGTERA, YYC[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a070872[/TD]
[TD="class: xl65"]AVGAYY AERVGCEA GMC[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a070872[/TD]
[TD="class: xl65"]AVGAYY AERVGCEA GMC[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a25a783[/TD]
[TD="class: xl65"]OERGUAOM EMTERYRGAEA GMC[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a25a783[/TD]
[TD="class: xl65"]OERGUAOM EMTERYRGAEA GMC[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a02832a[/TD]
[TD="class: xl65"]AOUTHERM YOYER COMYAMY[/TD]
[/TR]
[TR]
[TD="class: xl65"]72a02832a[/TD]
[TD="class: xl65"]AoutherM YoYer ComYaMy[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]720772893[/TD]
[TD="class: xl65"]TEMMEAAEE AMERGCAM YATER[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]720772893[/TD]
[TD="class: xl65"]TEMMEAAEE AMERGCAM YATER[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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