View Single Post
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default Here's an EASY one for you, not me :(

On Wed, 26 Oct 2005 22:57:51 -0500, barbierim
wrote:


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