0

enter image description here

See the image. I want the column to be converted into the row as in the image. Even if there are multiple text or numbers with commas in any single row within the column, then those needs to be considered as duplicates. How do I make the row that I have using a formula?

1
  • Are you looking for a VBA or formula solution? Commented Jan 5, 2017 at 18:03

1 Answer 1

1

Try this small user defined function:

Public Function MakeList(rng As Range) As String
    Dim c As Collection, r As Range, s As String
    Set c = New Collection
    For Each r In rng
        ary = Split(r.Value, ",")
        For Each a In ary
            On Error Resume Next
                c.Add a, CStr(a)
            If Err.Number = 0 Then
                MakeList = MakeList & "," & a
            Else
                Err.Number = 0
            End If
            On Error GoTo 0
        Next a
    Next r
    MakeList = Mid(MakeList, 2)
End Function

For example:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Where do I put the VBA code? I have no idea how to do this. I was actually looking for a built-in formula within excel
PressAlt+11, then insert a module and paste the code into the module.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.