VBA If, than, priority delete rows help

alieisx

New Member
Joined
Dec 16, 2014
Messages
2
Hi!

I'm trying to delete rows but there is a priority... The file size is 33,000 lines+

The columns look like this.

DUNS Maintenance Status
1012319 Active
1012319
1012319
1012319
1012319
1012319 Active

<tbody>
</tbody>

What I need to end up with is only one line per DUNs number with "Active" if its available while deleting any other duplicate active and blank lines. Maintenance Status only has the options of : Active, Inactive, ""

I've been messing with functions and different remove duplicate methods but with being required to do this now almost daily having a macro would save a significant amount of time.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Currently my order of operations is:

- Click "remove duplicates" selecting both columns
- Then use =COUNTIF($A:$A,A2)>1
- Take all the false and move them to a new page.
- Then sorting column B A to Z and then sorting column A, A to Z.
- The advanced filter unique values
- Cut, Paste to other page, done.

I could write a macro like this but it seems like there is a lot of room for error and there has got to be something easier...
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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