I have a datasheet with duplicates values in single cell. I would like to delete them using Macro.
Example: [TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 543"]
<tbody>[TR]
[TD="width: 543"]108,125,98,90,113,64,89,71;61,38,57,53,51,30,39;29,25,19,7,5,61,38,57,53,51,30,39,29,25,19,7,5,61,38,57,53,51,30,39,29,25,19,7,5;61,38,57,53,51,30,39;29,25,19,7,5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 543"]
<tbody>[TR]
[TD="width: 543"]34;19,12,9,6,19,12,9,6,19,12,9,6;19,12,9,6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Currently I am using this code, but it only seems to highlight duplicates, also only words not numbers.
Any suggestions would be very much appreciated.
Thanks in advance
Example: [TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 543"]
<tbody>[TR]
[TD="width: 543"]108,125,98,90,113,64,89,71;61,38,57,53,51,30,39;29,25,19,7,5,61,38,57,53,51,30,39,29,25,19,7,5,61,38,57,53,51,30,39,29,25,19,7,5;61,38,57,53,51,30,39;29,25,19,7,5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 543"]
<tbody>[TR]
[TD="width: 543"]34;19,12,9,6,19,12,9,6,19,12,9,6;19,12,9,6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Currently I am using this code, but it only seems to highlight duplicates, also only words not numbers.
Code:
[COLOR=#333333]Sub findspaces()[/COLOR] lastrow = Range("A65536").End(xlUp).Row
For I = 1 To lastrow
'x = 0
ask = Split(Cells(I, 1), " ")
For j = LBound(ask) To UBound(ask) - 1
x = 0
For k = j + 1 To UBound(ask)
If ask(j) = ask(k) Then
x = x + 1
End If
Next k
If x > 0 Then
pos = 0
For L = 1 To x + 1
pos = InStr(pos + 1, Cells(I, 1), ask(j))
Cells(I, 1).Select
With ActiveCell.Characters(Start:=pos, Length:=Len(ask(j))).Font
.Color = -16776961
End With
Next L
End If
Next j
Next I
[COLOR=#333333]End Sub[/COLOR]
Thanks in advance