Building Comma Delimited List of Symbols

  • Thread starter Thread starter TiVoSoFine
  • Start date Start date
T

TiVoSoFine

(newbie question)

I have a column with stock symbols, eg MSFT, JNPR, AMZR, etc. each o
on a different row. Now I want to build a string which is a comm
delimited list of these symbols and put it in another cell, which woul
make it "MSFT,JNPR,AMZR,...". How do I do it?

Thanks very much
 
=A1&","&A2&","&A3 etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi
you may use a UDF like the following:
Public Function mconcat(rng As Range) As String
Dim c As Range
Dim s_return As String
Application.Volatile
s_return = ""
For Each c In rng
If s_return = "" Then
s_return = c.Value
Else
s_return = s_return & "," & c.Value
End If
Next
mconcat = s_return
End Function

You can call it as follows:
=mconcat(A1:A3)
 
Back
Top