Sub RemoveCellDupes()
Dim lngLastRow As Long
Dim lngRow As Long
Dim colWords As Collection
Dim strWords() As String
Dim lngIndex As Long
Dim lngNextRow As Long
Const DATA_COL = "A" ' Change as needed
Const FIRST_ROW = 1 ' Change as needed
lngLastRow = Range(DATA_COL & "1048576").End(xlUp).Row
lngNextRow = FIRST_ROW
For lngRow = FIRST_ROW To lngLastRow
Set colWords = New Collection
strWords = Split(Cells(lngRow, DATA_COL), ",")
For lngIndex = 0 To UBound(strWords)
On Error Resume Next
colWords.Add Trim(strWords(lngIndex)), Trim(strWords(lngIndex))
Next
Cells(lngNextRow, DATA_COL).ClearContents
For lngIndex = 1 To colWords.Count
If lngIndex < colWords.Count Then
Cells(lngNextRow, DATA_COL) = Cells(lngNextRow, DATA_COL) & colWords(lngIndex) & ", "
Else
Cells(lngNextRow, DATA_COL) = Cells(lngNextRow, DATA_COL) & colWords(lngIndex)
End If
Next
lngNextRow = lngNextRow + 1
Next
End Sub
Function getUniqueWords(ByVal vStr As String) As String
Dim str() As String
Dim dict
Dim i As Long
str = Split(Replace(Replace(vStr, Chr(10), ""), " ", ""), ",")
Set dict = CreateObject("Scripting.Dictionary")
For i = 0 To UBound(str)
dict.Item(str(i)) = ""
Next i
If dict.Count > 0 Then getUniqueWords = Join(dict.keys, ", ")
End Function
=getUniqueWords(A2)