View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Concatenate an array

100 columns and how many rows?

This UDF will do the trick but after about 1024 characters in a cell you won't
see the text.

Function ConCatRange(CellBlock As Range) As String
Dim cell As Range
Dim sbuf As String
For Each cell In CellBlock
If Len(cell.text) 0 Then sbuf = sbuf & cell.text & ","
'remove the & "," if you don't want a comma
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =ConCatRange(A1:CV1)


Gord Dibben MS Excel MVP


On Sat, 1 Jul 2006 11:20:02 -0700, Ed wrote:

Hello I guess it might not possible, but I have around 100 columns each with
a single character, I would like to concatenate those into a single cell, is
that possible in ANY way?

thanks