View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Luke M[_4_] Luke M[_4_] is offline
external usenet poster
 
Posts: 457
Default Concatenate lists

My suggestion would be to use an UDF. I think sooner or later, everyone
eventually realizes the need for something like this. This function will
concatenate every cell within a selected range, and you can choose what your
delimiter looks like. Install this into a Module in VBA.

'=========
Function ConcMe(r As Range, Optional x As String = ", ") As String
For Each c In r
'If cell is blank, don't include
If c.Value = "" Then GoTo NoInclude
ConcMe = ConcMe & c.Value & x
NoInclude:
Next c
'Remove final delimiter
ConcMe = Left(ConcMe, Len(ConcMe) - Len(x))
End Function
'==========

Then, back in your workbook, the formula is:
=ConcMe(A1:A50,"_")

--
Best Regards,

Luke M
"Hanspeter" wrote in message
...
Is there an Easier way to Concatenate a number of cells greater than 50
cells
in once cell without using A1&"_"&A2&"_"& and so on.

HAns