CONCATENATE

T

Tservo

I would LOVE to combine cells from the same column instead of cut & pasting
information. - example D132 through D147 and have this combined information
appear in D132. Is this possible?
 
J

Joe User

Tservo said:
I would LOVE to combine cells from the same
column instead of cut & pasting information.
- example D132 through D147 and have this
combined information appear in D132. Is this
possible?

=D132 & D133 & ... & D146 & D147

You can separate the cell contents by concatenating strings. for example:

=D132 & " " & D133 & ... & D146 & " " & D147

Obvious, this is tedious for a large range like D132:D147. The CONCATENATE
function does not accept ranges either.
 
G

Gord Dibben

Simple form...........

In D131..............not D132!

=D132&D133&D134&D135 etc.

Not so simple form..............

=D132 $ " " D133 & " " & D134 etc.

Easy way.............use a UDF

Function ConCatRange22(CellBlock As Range, Optional Delim As String = "") _
As String
'entered as =concatrange22(a1:a10,", ") desired delimiter between quotes
'as written delimiter is comma space
Dim Cell As Range
Dim sbuf As String

For Each Cell In CellBlock.Cells
If Cell.text <> "" Then
sbuf = sbuf & Cell.text & Delim
End If
Next Cell

ConCatRange22 = Left(sbuf, Len(sbuf) - Len(Delim))

End Function

Paste the UDF to a General module in your workbook.


Gord Dibben MS Excel MVP
 

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