Removing Duplicates in a single cell with multiple separator

JezaDominic

New Member
Joined
Dec 23, 2015
Messages
6
Hi I'm having a helluva time with excel since I remove duplicates from 33k row of entries from column A to P
Now I came across an issue, I need to merge multiple address in a single file row how ever each entry have multiple name, I need help in removing those multiple names after merging.
Below is an example, Each row has a merged duplicate entry per cell, the duplicated need to be remove but after running macros it seems that it does not work per cell.

1825
12664
1186 Holly Ave
3415 Beech St
Imperial Beach
San Diego
United States Of America
United States Of America
1220 Pacific Hwy #241
1220 Pacific Hwy #241
San Diego
San Diego
CA
CA
92101
92101
11777
26250
321-27 Imperial Ave
5321 Imperial Ave
San Diego
San Diego
United House Of Prayer For
United House Of Prayer For
3200 Freedom Dr
3200 Freedom Dr
Charlotte
Charlotte
NC
NC
28208
28208
28580
3043
17622
6707 Amherst St
1328 Hoover Ave
41 E 6th St
San Diego
National City
National City
United Brokers Realty Inc
United Brokers Realty Inc
United Brokers Realty Inc
Cooper Scafani & Assocs5155 Waring Rd
5155 Waring Rd
5155 Waring Rd
San Diego
San Diego
San Diego
CA
CA
CA
92120
92120
92120
8328
12180
2330 Grove Ave
330-56 Grove Ave
San Diego
San Diego
Unison Investments
Unison Investments
Jen-Liang Wu - Ptr.
Jen-Liang Wu - Ptr.
23545 Crenshaw Bl #201
23545 Crenshaw Bl #201
Torrance
Torrance
CA
CA
90505
90505



<tbody>
</tbody>
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
It's hard to visualize what you are trying to do. Can you create a simple example of before and after, showing what you are trying to achieve?
 
Upvote 0
Thanks you for your quick responce here is an example of the after, using the example above.


Address 1Owner.NameOwner.CompanyOwner.Address 1
18251186 Holly AveImperial Beach United States Of America 1220 Pacific Hwy #241 San DiegoCA92101
126643415 Beech StSan Diego
11777321-27 Imperial AveSan Diego United House Of Prayer For 3200 Freedom Dr CharlotteNC28208
262505321 Imperial AveSan Diego
285806707 Amherst StSan Diego United Brokers Realty IncCooper Scafani & Assocs5155 Waring Rd San DiegoCA92120
30431328 Hoover AveNational City
1762241 E 6th StNational City
83282330 Grove AveSan Diego Unison InvestmentsJen-Liang Wu - Ptr.23545 Crenshaw Bl #201 TorranceCA90505
12180330-56 Grove AveSan Diego

<colgroup><col><col><col span="2"><col><col><col><col span="4"></colgroup><tbody>
</tbody>

I really would appreciate your help.. TIA :)
 
Upvote 0
Paulo L thanks your quick reponse

Below is what I'm trying to achieve.
Address 1Owner.NameOwner.CompanyOwner.Address 1
18251186 Holly AveImperial Beach United States Of America 1220 Pacific Hwy #241 San DiegoCA92101
126643415 Beech StSan Diego
11777321-27 Imperial AveSan Diego United House Of Prayer For 3200 Freedom Dr CharlotteNC28208
262505321 Imperial AveSan Diego
285806707 Amherst StSan Diego United Brokers Realty IncCooper Scafani & Assocs5155 Waring Rd San DiegoCA92120
30431328 Hoover AveNational City
1762241 E 6th StNational City
83282330 Grove AveSan Diego Unison InvestmentsJen-Liang Wu - Ptr.23545 Crenshaw Bl #201 TorranceCA90505
12180330-56 Grove AveSan Diego

<colgroup><col><col><col span="2"><col><col><col><col span="5"></colgroup><tbody>
</tbody>
I'd really appreciate your help on this. :)
 
Upvote 0
I tried running this but Its prompting me out of range
Sub Remove_DupesInString()
Dim str As String
Dim fval As String
Dim strArr() As String
Dim x As Long
Dim k As Long
Set sht = Sheets("Sheet1")
Lastrow = sht.Cells(Cells.Rows.Count, "P99999").End(xlUp).Row
For Each cell In sht.Range("$B$2:P" & Lastrow)
Erase strArr
fval = ""
str = cell.Value
strArr = Split(str, "/")
For rw = 0 To UBound(strArr)
For k = rw + 1 To UBound(strArr)
If Trim(strArr(k)) = Trim(strArr(rw)) Then
strArr(k) = "" 'if duplicate clear array value
End If
Next k
Next rw
For x = 0 To UBound(strArr)
If strArr(x) <> "" Then
fval = fval & Trim(strArr(x)) & "/"
End If
Next x
fval = Left(fval, Len(fval) - 1)
cell.Value = fval
Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

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