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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

JODomingos

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


For instance: It would remove row (4;12;16...)
 

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
3,229
Office Version
  1. 2016
Platform
  1. Windows
Sort by column B, largest to smallest. Then use the Delete Duplicates tool.
 

JODomingos

New Member
Joined
Jul 11, 2020
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
But This deletion is going to be random, isn't?
 

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
3,229
Office Version
  1. 2016
Platform
  1. Windows

ADVERTISEMENT

But This deletion is going to be random, isn't?
I don't understand what you mean.
Why not try it on some sample data?
 

JODomingos

New Member
Joined
Jul 11, 2020
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
[I Tried footoo, but it did not working. Is it possible to have a macro for that? It would be great friend
 

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
3,229
Office Version
  1. 2016
Platform
  1. Windows
In what way did it not work? Works for me.
 

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
3,229
Office Version
  1. 2016
Platform
  1. Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,129,896
Messages
5,638,879
Members
417,057
Latest member
Jimbo Jones

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
Top