Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
elliott
 
Posts: n/a
Default How do I merge the contents (separated by a comma) of 300+ cells?


  #2   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

elliott wrote:

Why do people post notes with no content? Does it take an extra 100mS
to actually type your question with some example of the data rather than
trying to put it all in the subject line which frequently gets truncated
anyhow?

Bill
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Bill

Because they are using the not-so-efficient CDO and that seems to be the norm
around there.

Gord

On Tue, 10 May 2005 13:43:11 -0400, "Bill Martin -- (Remove NOSPAM from
address)" wrote:

elliott wrote:

Why do people post notes with no content? Does it take an extra 100mS
to actually type your question with some example of the data rather than
trying to put it all in the subject line which frequently gets truncated
anyhow?

Bill


  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Elliot

Are the cells contiguous or random?

If contiguous, easily done with a user defined function.

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

=ConCatRange(A1:J30) entered in K1

Or a macro....

Sub ConCat_Cells()
Dim x As Range
Dim y As Range
Dim z As Range
Dim w As String
Dim sbuf As String
On Error GoTo endit
w = InputBox("Enter the Type of De-limiter Desired")
Set z = Application.InputBox("Select Destination Cell", _
"Destination Cell", , , , , , 8)
Application.SendKeys "+{F8}"
Set x = Application.InputBox _
("Select Cells...Contiguous or Non-Contiguous", _
"Cells Selection", , , , , , 8)
For Each y In x
If Len(y.text) 0 Then sbuf = sbuf & y.text & w
Next
z = Left(sbuf, Len(sbuf) - 1)
Exit Sub
endit:
MsgBox "Nothing Selected. Please try again."
End Sub


Gord Dibben Excel MVP

On Tue, 10 May 2005 10:16:03 -0700, "elliott"
wrote:


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
Going from column to comma separated list... jmboggiano Excel Discussion (Misc queries) 1 March 10th 05 04:30 PM
MSExcel--words in a cell separated by comma need to be moved into. Gary in Alaska Excel Worksheet Functions 2 March 8th 05 08:45 PM
How do I transpose Comma Separated Data in each cell and delete t. randy Excel Discussion (Misc queries) 2 February 15th 05 11:07 PM
How do i merge data in a row of cells to be comma separated in on. Banana Excel Discussion (Misc queries) 1 February 7th 05 05:42 PM
How do I merge the contents of two columns? adamnabors Excel Discussion (Misc queries) 1 December 2nd 04 11:35 PM


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

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

About Us

"It's about Microsoft Excel"