ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Concatenate a strings range. (https://www.excelbanter.com/excel-programming/295794-concatenate-strings-range.html)

y

Concatenate a strings range.
 
CONCATENATE accepts only single cells.

How can I concatencate contiguos cells (a range of strings) without writing each cell reference by hand?

Only via VBA? And how?

Thank you Alex.


Frank Kabel

Concatenate a strings range.
 
Hi Alex
one way:
1. download the free add-in Morefunc.xll . It includes the
function
MCONCAT (http://longre.free.fr/english/)

2. Use the formula
=MCONCAT(A1:E1,", ")

-----Original Message-----
CONCATENATE accepts only single cells.

How can I concatencate contiguos cells (a range of

strings) without writing each cell reference by hand?

Only via VBA? And how?

Thank you Alex.

.


Tim Zych[_7_]

Concatenate a strings range.
 
Don't know about any built in function that will do that. A macro way:

Dim cell As Range, str As String
Dim delim As String
delim = ","
For Each cell In Range("A1:A100").Cells
If Len(cell.Value) 0 Then
str = str & cell.Value & delim
End If
Next cell

If Len(str) 0 Then
str = Left(str, Len(str) - Len(delim))
End If

"y" wrote in message ...
CONCATENATE accepts only single cells.

How can I concatencate contiguos cells (a range of strings) without

writing each cell reference by hand?

Only via VBA? And how?

Thank you Alex.




Peter Huang

Concatenate a strings range.
 
Hi Alex,

Did Frank and Tim's suggestion help you?
I think for now, if you do not want to use othe addins to achieve your aim,
I agree with Tim's suggestion. We may need to write an funciton with VBA to
handle the range of cells' text.

If you still have any concern on this issue, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com