If content in a cell is duplicated within that cell, remove the duplicates Hi th
ID: 3570954 • Letter: I
Question
If content in a cell is duplicated within that cell, remove the duplicates
Hi there
I have a column which contains words that in some instances are duplicated within that cell. I need to remove the duplicates of that information.
I've uploaded a file here - http://www.filedropper.com/eg
The relevant column is column F.
I'd like it so that the end result shows only one instance of each word in the cell.
Some words will include special characters within them such as English++ or American-English
Thanks in advance for your help!!
Explanation / Answer
Hi..
ALT+F11 to open VB editor, right click 'ThisWorkbook' and insert moodule and paste the code below in on the right. Close VB editor. Back on the worksheet put this in H2 and drag down.
=Uniques(F2)
NOTE. In F5 you have the string below where English is spelleed incorrectly so will not be removed as a duplicate.
Function Uniques(Str As String) As String.
Dim inArray() As String
Dim xVal As Variant
inArray = Split(Str, " ")
For Each xVal In inArray
If InStr(Uniques, Trim(xVal)) = 0 Then _
Uniques = Uniques & Trim(xVal) & " "
Next xVal
Uniques = Left(Uniques, Len(Uniques) - 1).
End Function
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.