Remove Duplicate rows but Keeping the highest value

JODomingos

New Member
Joined
Jul 11, 2020
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
Hi Fellows.

I need to remove duplicate rows in column A, but I want to keep only the uniques with the highest value in column B. As I have information in columns C,D,E,F.... I have remove them but mantaining the entire row for those keeped.

Can you Help me?
Thanks in advance!!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
1594864048862.png


For instance: It would remove row (4;12;16...)
 
Upvote 0
Sort by column B, largest to smallest. Then use the Delete Duplicates tool.
 
Upvote 0
[I Tried footoo, but it did not working. Is it possible to have a macro for that? It would be great friend
 
Upvote 0
In what way did it not work? Works for me.
 
Upvote 0
Here's a macro based on the steps I suggested in post #3.
VBA Code:
Sub v()
Dim lc& : lc = Cells(1, Columns.Count).End(1).Column
Dim lr& : lr = Cells(Rows.Count, 1).End(3).Row
With Range([A3], Cells(lr, lc))
    .Sort Key1:=[A3], Order1:=xlAscending, _
        Key2:=[B3], order2:=xlDescending, Header:=xlYes
    .RemoveDuplicates Columns:=1, Header:=xlYes
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

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