Remove all duplicate rows if column A as duplicates but refer to column B

Wisdomup

New Member
Joined
Aug 2, 2022
Messages
1
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
Platform
  1. Windows
Dear All,

I am beginner of VBA, I wanna create a VBA that can remove deplicate rows if column A as duplicate and referring to Column B value.

For instance, pic. 1 is raw data, pic. 2 is the results that I wanted.

From pic.1 , there are 4 duplicate groups (ABC123, AD12, AA12, mm).

2 things I want to do is
#1, remove duplicate group if column B have “B55”
#2, remove duplicate group if Column B doesn’t contains “A123”

So
#1. ABC123 and AD12 will remove all due to one of them contain “B55”
#2. mm will remove all due to they doesn’t contains “A123”

Thanks all helper!!!!
 

Attachments

  • 298C9680-0363-4B94-B04F-C77EA9ED10CA.jpeg
    298C9680-0363-4B94-B04F-C77EA9ED10CA.jpeg
    80.3 KB · Views: 30
  • 9E2EF7D6-0602-4B4D-943C-B5BAFEA30D35.jpeg
    9E2EF7D6-0602-4B4D-943C-B5BAFEA30D35.jpeg
    35.4 KB · Views: 27

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,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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