Best way to remove rows with duplicates by a values from a specific column, but leaving whole blank rows (not treating them as a duplicate)

thardy00

New Member
Joined
Jan 25, 2022
Messages
13
Office Version
  1. 2019
Platform
  1. Windows
Hi there!

I am looking for a best way to remove rows with duplicates base on values from a specific column (let's say column D for e.g.), but I would like to leave whole blank rows (do not treat them as a duplicate). Right now I'm using built-in Excel "Data --> Remove duplicates" and I'm selecting a column on which I want to base my removing process and additional column in which formula
VBA Code:
=IF(LEN(TRIM(A1))=0,ROW(),"")
fills blank lines with increasing numbers so Excel don't treat those lines as a duplicate.

My solution is working, but I feel like it's more like work around the problem and not dealing with the problem directly.

Maybe someone will have some ideas how to solve this case in a better way?

Best regards,
Tom.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,223,636
Messages
6,173,485
Members
452,516
Latest member
archcalx

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