Here's an EASY one for you, not me :(

B

barbierim

OK I have zipcodes in column A (a1-a700) and I would like to put all
into B1 separated by a ",".

so that B1 will have 700 zipcodes all separated by a comma

what's the formula?

Gracias in advance
Mark
 
R

Ron Rosenfeld

OK I have zipcodes in column A (a1-a700) and I would like to put all
into B1 separated by a ",".

so that B1 will have 700 zipcodes all separated by a comma

what's the formula?

Gracias in advance
Mark

You need a UDF.

<alt><F11> opens the VB Editor.

Ensure your project is highlighted in the project explorer window. Then
Insert/Module and paste the code below into the window that opens.

Return to your worksheet and enter the formula:

B1: =concatssn(A1:A700)


==================================
Option Explicit

Function ConCatSSN(rg) As String
Dim c As Variant
For Each c In rg
ConCatSSN = ConCatSSN & ", " & c.Text
Next
ConCatSSN = Replace(ConCatSSN, ", ", "", , 1)
End Function
==========================


--ron
 
A

Alvin

i don't know if there is any direct function for this....
i suggest you to use VBA..

Function Concate(x)
For Each b In x.Cells
a = a & b & ", "
Next
Concate = Left(a, Len(a) - 1)
End Function

just type in B1:
=Concate(a1:a700)
 
B

barbierim

Ron said:
You need a UDF.

<alt><F11> opens the VB Editor.

Ensure your project is highlighted in the project explorer window.
Then
Insert/Module and paste the code below into the window that opens.

Return to your worksheet and enter the formula:

B1: =concatssn(A1:A700)


==================================
Option Explicit

Function ConCatSSN(rg) As String
Dim c As Variant
For Each c In rg
ConCatSSN = ConCatSSN & ", " & c.Text
Next
ConCatSSN = Replace(ConCatSSN, ", ", "", , 1)
End Function
==========================


--ron
Worked like a charm, Thanks
MB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top