Remove duplicates

aghaffar82

Board Regular
Joined
Jun 13, 2019
Messages
65
Office Version
  1. 365
Platform
  1. Windows
Hello Experts

I am wanting to get rid of duplicate entries that are scattered all over the sheet and intend to keep the left-most as a unique value. so far example if there is a name appearing 3 times in the whole data set, I would like to keep the name that appears in the left-most column.

A small sample is attached for your kind reference and expert look: in the example below, I would like to delete the cell/content B13, D17 & E10.

Sample 5000 Rows-v2.xlsx
ABCDE
1parrotchristytarahotfab
2jpjoshfanpatadi
3agchamgemdanasdq
4Singhlavbestyzurathore
5benjaminanafarangebegood
6jolucaismilingridhx
7josephkalrderrsoyval
8rickymaretanivanalfonso
9pattyvloserviszullymarey
10euroqtmudiitsonana
11Alinightmossesandremidnight
12mattdaygabypamkeo
13dannyjojonsaifchar
14ninafarrukhevederymouad
15prismsamhachtaniakhalid
16tigerbarryflootblushwrath
17catdiaholksamdivine
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:E17Cell ValueduplicatestextNO
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What do you want to do with the remaining data once the duplicates have been deleted?

There are 5 possible outcomes that come to mind without even thinking about it.
 
Upvote 0
What do you want to do with the remaining data once the duplicates have been deleted?

There are 5 possible outcomes that come to mind without even thinking about it.
Thank you for your response
I need to upload it to our marketing software. Every column actually is a category and the left most is the most important and target customer can appear more than once and duplicates are to be removed from the right columns.
Hope that makes sense.
 
Upvote 0
Thank you for your response
I need to upload it to our marketing software. Every column actually is a category and the left most is the most important and target customer can appear more than once and duplicates are to be removed from the right columns.
Hope that makes sense.
I meant a customer cannot appear more than once in the entire sheet.
 
Upvote 0
Clear the name and leave a blank cell where the duplicate was?
Delete the cell and move the other names in the same column up, leaving the blanks at the bottom?
Delete the cell and move the other names in the row left, leaving the blanks on the right?
Delete the cell and move the other names in the same column up, move the first entry from the next column to fill the empty cell at the bottom, leaving any empty cells at the bottom of the final column?
Delete the cell and move the other names in the same row left, move the first entry from the next row to fill the empty cell on the right, leaving any empty cells at the end of the final row?
 
Upvote 0
Sir this would be great: "Delete the cell and move the other names in the same column up, leaving the blanks at the bottom".
 
Upvote 0
Or perhaps, deleting the content of the cells would be faster as there would be around 30 columns and some of them would have about a million rows. Thank you
 
Upvote 0
Cross posted Delete duplicating entries across the worksheet

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered elsewhere.
 
Upvote 0
Cross posted Delete duplicating entries across the worksheet

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered elsewhere.
I am really sorry for doing so and as soon as I get an answer here or on the other site, I will update both the threads. Thank you
 
Upvote 0
VBA Code:
Public Sub RmvDbl()

Dim Rng As Range, MyRng As Range
Dim TXT As String, T As String
Dim TxTArr As Variant
Set MyRng = Range("A1").CurrentRegion
TXT = ""
    For C = 1 To MyRng.Columns.Count
        For Each Rng In MyRng.Columns(C).Cells
        T = " " & Rng.Value & " "
            If InStr(1, TXT, T, vbTextCompare) = 0 Then
            TXT = TXT & IIf(TXT <> "", ",", "") & T
            Else
            End If
        Next
    Next
    
    TxTArr = Split(TXT, ",")
    
   srw = MyRng.Row + MyRng.Rows.Count + 2
   Scl = MyRng.Column
   N = MyRng.Rows.Count
   For i = LBound(TxTArr) To UBound(TxTArr)
    RW = (((i + 1) - 1) Mod N) + 1
    cl = WorksheetFunction.Ceiling((i + 1), N) / N
    Cells(srw + RW, Scl + cl - 1) = Trim(TxTArr(i))
  
   Next
End Sub
Test.xlsm
ABCDE
1parrotchristytarahotfab
2jpjoshfanpatadi
3agchamgemdanasdq
4Singhlavbestyzurathore
5benjaminanafarangebegood
6jolucaismilingridhx
7josephkalrderrsoyval
8rickymaretanivanalfonso
9pattyvloserviszullymarey
10euroqtmudiitsonana
11Alinightmossesandremidnight
12mattdaygabypamkeo
13dannyjojonsaifchar
14ninafarrukhevederymouad
15prismsamhachtaniakhalid
16tigerbarryflootblushwrath
17catdiaholksamdivine
18
19
20
21parrotchristyfanpatasdq
22jpjoshgemdanrathore
23agchambestyzubegood
24Singhlavfarangehx
25benjaminanaismilingridval
26jolucaderrsoyalfonso
27josephkalrtanivanmarey
28rickymareserviszullymidnight
29pattyvloudiitsonkeo
30euroqtmmossesandrechar
31Alinightgabypammouad
32mattdayjonsaifkhalid
33dannyfarrukhevederywrath
34ninasamhachtaniadivine
35prismbarryflootblush
36tigerdiaholkfab
37cattarahotadi
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,167
Members
448,870
Latest member
max_pedreira

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