Link to home
Start Free TrialLog in
Avatar of SiHodgy007
SiHodgy007Flag for United Kingdom of Great Britain and Northern Ireland

asked on

How to make sure there are no duplicate added to a string

After calling this function I would like to know how to make sure duplicate entries don't go in.

Function getEmailString(ByVal Rng As Range) As String
Dim Cell As Range
Dim Str As String
For Each Cell In Rng
    If Cell <> "" Then
        If Str = "" Then
            Str = Cell.Value
        Else
            Str = Str & ";" & Cell.Value
        End If
    End If
Next Cell
getEmailString = Str
End Function
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I provided the same function in your last question. :)
Avatar of SiHodgy007

ASKER

I know I opened this as instructed before you answered and couldn't close it
No problem then. I thought the function didn't work for you so you posted the same question again. :)