FeedbackNoob
New Member
- Joined
- Jul 16, 2019
- Messages
- 1
Hi guys,
I've just started a new role and I need to find all duplicates in data over the past 6 months as my predecessor hadn't been doing this, and the idea of doing it manually for 8000 lines of data is terrifying me. Can anyone help me with VBA code to pull all duplicates into another spreadsheet?
My file looks something like the following, with around 30 columns and 8000 rows of data.
[TABLE="width: 900"]
<tbody>[TR]
[TD]Identifier Number[/TD]
[TD]Business Name[/TD]
[TD]Account Manager[/TD]
[TD]Business Type[/TD]
[TD]Contact Reason[/TD]
[TD]Date of Contact[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]Bobs Bacon[/TD]
[TD]Johnny Jones[/TD]
[TD]Food Outlet[/TD]
[TD]Pricing[/TD]
[TD]01/01/2018[/TD]
[/TR]
[TR]
[TD]82654[/TD]
[TD]Sarah's Shellfish[/TD]
[TD]Jack Daniels[/TD]
[TD]Food Outlet[/TD]
[TD]Lack of contact[/TD]
[TD]06/04/2018[/TD]
[/TR]
[TR]
[TD]48572[/TD]
[TD]Connors Corner Store[/TD]
[TD]Jim Smith[/TD]
[TD]Convenience[/TD]
[TD]Customer service[/TD]
[TD]09/08/2018[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]Bobs Bacon[/TD]
[TD]Johnny Jones[/TD]
[TD]Food Outlet[/TD]
[TD]Damaged stock[/TD]
[TD]11/09/2018[/TD]
[/TR]
</tbody>[/TABLE]
What I need is to find all duplicates of the identifier number (even if the rest don't match) which is in Column B in my worksheet, and then pull the whole row of data into another spreadsheet, so I can follow up on why these duplicates exist.
For example in the table above 12345 Bobs Bacon occurs twice with a different contact reason but I would need to pull both of these into another sheet.
I've tried doing this with a pivot table but it doesn't really work for me, and I've found and tweaked some macros online, but they ignore the first instance and just pull those listed after the first. I don't know enough to be sure on how to change this.
Any help, even just pointing me in the right direction on how to do this would be amazing. Thank you in advance
I've just started a new role and I need to find all duplicates in data over the past 6 months as my predecessor hadn't been doing this, and the idea of doing it manually for 8000 lines of data is terrifying me. Can anyone help me with VBA code to pull all duplicates into another spreadsheet?
My file looks something like the following, with around 30 columns and 8000 rows of data.
[TABLE="width: 900"]
<tbody>[TR]
[TD]Identifier Number[/TD]
[TD]Business Name[/TD]
[TD]Account Manager[/TD]
[TD]Business Type[/TD]
[TD]Contact Reason[/TD]
[TD]Date of Contact[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]Bobs Bacon[/TD]
[TD]Johnny Jones[/TD]
[TD]Food Outlet[/TD]
[TD]Pricing[/TD]
[TD]01/01/2018[/TD]
[/TR]
[TR]
[TD]82654[/TD]
[TD]Sarah's Shellfish[/TD]
[TD]Jack Daniels[/TD]
[TD]Food Outlet[/TD]
[TD]Lack of contact[/TD]
[TD]06/04/2018[/TD]
[/TR]
[TR]
[TD]48572[/TD]
[TD]Connors Corner Store[/TD]
[TD]Jim Smith[/TD]
[TD]Convenience[/TD]
[TD]Customer service[/TD]
[TD]09/08/2018[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]Bobs Bacon[/TD]
[TD]Johnny Jones[/TD]
[TD]Food Outlet[/TD]
[TD]Damaged stock[/TD]
[TD]11/09/2018[/TD]
[/TR]
</tbody>[/TABLE]
What I need is to find all duplicates of the identifier number (even if the rest don't match) which is in Column B in my worksheet, and then pull the whole row of data into another spreadsheet, so I can follow up on why these duplicates exist.
For example in the table above 12345 Bobs Bacon occurs twice with a different contact reason but I would need to pull both of these into another sheet.
I've tried doing this with a pivot table but it doesn't really work for me, and I've found and tweaked some macros online, but they ignore the first instance and just pull those listed after the first. I don't know enough to be sure on how to change this.
Any help, even just pointing me in the right direction on how to do this would be amazing. Thank you in advance