Remove duplicate by selected

Sefty

Board Regular
Joined
Apr 5, 2022
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hello,
i need help, how to delete duplicates, and only select the last data. For example, if there are 3 data that are the same, then only the third data is taken
data that needs to be deleted per row, duplicates based on column B but need to delete all rows and only leave 1 last row.
Thanks
Book1
ABCDEF
1Before
2HariAbc
3Sundayaab
4Sundayfgjj
5Sunday12jj
6Monday457
7Monday901
8Friday125
9Friday146
10
11
12After
13HariAbc
14Sunday12jj
15Monday901
16Friday146
17
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:B9,B12Cell ValueduplicatestextNO
B14:B16Cell ValueduplicatestextNO
 
One other comment about your codes: I note that you have declared lRow as long but left i undeclared (& therefore Variant). I would recommend declaring all variables (& forcing yourself to do so with the 'Require Variable Declaration' setting in the vba Options).
That's my worst habbit :/
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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