I am using a userform to that is populated from an excel sheet and modified from another userform. I used this code to remove duplicates, but it doesn't account for commas.
Is there any easy way to account for commas?
For example: 10.1, 10.2, 10.3, 10.4, 10.1, 10.2, 10.3
output with this code is: 10.1, 10.2, 10.3, 10.4, 10.3 because there is no comma after the second 10.3 it does not register as a duplicate.
I want the output to remove the last number and the commas. So, essentially, I want the code to remove the number and any following commas.
VBA Code:
Function Uniques(Text As String) As String
Dim X As Long, Data() As String
Data = Split(Text)
With CreateObject("Scripting.Dictionary")
[COLOR=#0000ff].CompareMode=1[/COLOR]
For X = 0 To UBound(Data)
.Item(Data(X)) = 1
Next
Uniques = Join(.keys)
End With
End Function
Is there any easy way to account for commas?
For example: 10.1, 10.2, 10.3, 10.4, 10.1, 10.2, 10.3
output with this code is: 10.1, 10.2, 10.3, 10.4, 10.3 because there is no comma after the second 10.3 it does not register as a duplicate.
I want the output to remove the last number and the commas. So, essentially, I want the code to remove the number and any following commas.