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: 11
  • 9E2EF7D6-0602-4B4D-943C-B5BAFEA30D35.jpeg
    9E2EF7D6-0602-4B4D-943C-B5BAFEA30D35.jpeg
    35.4 KB · Views: 9

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,215,129
Messages
6,123,218
Members
449,091
Latest member
jeremy_bp001

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