PC Review


Reply
Thread Tools Rate Thread

How copy data form multi cells to one cell?

 
 
B
Guest
Posts: n/a
 
      18th Mar 2011
Hi,
I have problem with copping data form cells. I want to copy data from
multiple cells into one.
After pasting the data should be combined by char NewLine.
I tried to use function "text connections" connect.text (a1: A100) but
it does not work. Only work if i put (a1;a2;a3) but i have meny cells.

How do this?
 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      18th Mar 2011
You can do it using a formula with the concatenation operator as so.

=A1&Char(10)&A2&Char(10)

But that has its limits.

You could use a UDF like this to combine with linefeeds. Blank cells will be
ignored.

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 & Chr(10)
Next
ConCatRange = Left(sbuf, Len(sbuf) - 2)
End Function

Usage: =ConCatRange(A1:A100)

Set the cell to wrap text but with 100 linefeeds you will not be able to autofit
the row height to accommodate that much data.


Gord Dibben MS Excel MVP

On Fri, 18 Mar 2011 13:17:21 +0100, B <(E-Mail Removed)> wrote:

>Hi,
> I have problem with copping data form cells. I want to copy data from
>multiple cells into one.
>After pasting the data should be combined by char NewLine.
>I tried to use function "text connections" connect.text (a1: A100) but
>it does not work. Only work if i put (a1;a2;a3) but i have meny cells.
>
>How do this?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Data to Cells, but Stop at Next Non-Empty Cell Fester Microsoft Excel Discussion 4 17th Feb 2009 04:57 PM
I WANT THE MULTI CELL DATA IN ADDRESS FORM OR IN ONE CELL farhan Microsoft Excel Misc 1 10th Jul 2008 08:15 AM
Send multi data (Graph/Cell data) to Word doc as 1 item (no cells) =?Utf-8?B?VG9tLUxF?= Microsoft Excel Misc 0 30th Aug 2006 10:10 PM
how do i seprate multi data cell into 2 or more cells =?Utf-8?B?dmlubG91aXM=?= Microsoft Excel New Users 2 22nd Feb 2005 05:26 PM
Copy cell data to 2 cells Johnnyb Microsoft Excel Worksheet Functions 2 22nd Jul 2004 12:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:05 AM.