Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Concatenate many rows quickly

Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Concatenate many rows quickly

Copy, Edit/ Paste Special/ Transpose to turn your column into a row.
Set your Windows Regional Options to have semi-colon instead of a comma as
list separator, then save as CSV. Your CSV will have the original rows
separated by semi-colons.
You can then set your Windows Regional Options back to comma as separator.
--
David Biddulph

wrote in message
...
Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Concatenate many rows quickly

The following UDF will concatenate any range of cells into a single cell:

Function spliceUm(r As Range) As String
spliceUm = ""
For Each rr In r
spliceUm = spliceUm & rr.Value & ";"
Next
End Function

After you install the UDF, you can use it like:

=spliceUm(A1:D11)
or
=spliceUm(1:1)

etc.
--
Gary''s Student - gsnu2007g


" wrote:

Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Concatenate many rows quickly

A1 & B1 is concatenating columns, not rows.

Note: you can enter 32767 characters in a cell but you will see or print only
about 1024 characters in that cell so you won't get much out of putting that
much text in a single cell.

Whatever the case, try this UDF.

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 & ";"
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =ConCatRange(A1:A1000)

This UDF is to be copied and pasted into a general module in your workbook.

Alt + F11 to open VBEditor. Ctrl + r to open Project Explorer.

Right-click on your workbook/project and InsertModule.

Paste into that module.

Alt + q to return to the Excel Window.

Enter the formula into a cell.


Gord Dibben MS Excel MVP



On Sun, 30 Mar 2008 13:01:38 -0700 (PDT), wrote:

Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Concatenate many rows quickly

Download and install the free add-in Morefunc.xll from:
http://xcell05.free.fr/english/

=SUBSTITUTE(TRIM(MCONCAT(IF(A1:Z1<"",A1:Z1,"")&" "))," ",";")

ctrl+shift+enter, not just enter


" wrote:

Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Concatenate many rows quickly

(a) concatenate 1000 rows of data

Note that MCONCAT is *limited* to a return of 255 characters including the
delimiter.


--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
Download and install the free add-in Morefunc.xll from:
http://xcell05.free.fr/english/

=SUBSTITUTE(TRIM(MCONCAT(IF(A1:Z1<"",A1:Z1,"")&" "))," ",";")

ctrl+shift+enter, not just enter


" wrote:

Can someone tell me how to write a function that will:

(a) concatenate 1000 rows of data (into a single cell)
(b) delimit each of those rows with a ;

The "A1&";"&B1&..." method is painfully slow, even with copy paste.

Thank you.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
reformating data- how to delete alternate blank rows quickly datamanipulator Excel Discussion (Misc queries) 4 November 27th 07 04:41 PM
Quickly moving rows of 5-column groups on 1 continuous line C.O. Excel Worksheet Functions 2 December 7th 06 09:59 PM
How to quickly paste almost same formula to set rows? cardingtr Excel Discussion (Misc queries) 3 February 20th 06 07:53 PM
How to quickly insert a blank row every 5 rows? Med Excel Discussion (Misc queries) 2 September 10th 05 12:32 AM
How do I Concatenate these Dynamic Rows AwkSed2Excel Excel Worksheet Functions 7 June 7th 05 03:30 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"