Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Many rows to One row

RAB

Looks like you want the results to be placed in one cell, not one row.

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, 20 Jul 2004 18:45:04 -0700, RAB wrote:

I have data that looks like this:

199 7/20/2004 1Z9952220245265501
199 7/20/2004 1Z9952220245959119
199 7/20/2004 1Z9952220244763322
200 7/21/2004 1Z9952220244788457

I need the data to look like this: (commas or spaces) doesn't matter

199,7/20/2004,1Z9952220245265501,1Z9952220245959119,1Z99522 20244763322
200,7/21/2004,1Z9952220244788457


  #2   Report Post  
Posted to microsoft.public.excel.programming
Rab Rab is offline
external usenet poster
 
Posts: 12
Default Many rows to One row

Thank you so much.....

"Gord Dibben" wrote:

RAB

Looks like you want the results to be placed in one cell, not one row.

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, 20 Jul 2004 18:45:04 -0700, RAB wrote:

I have data that looks like this:

199 7/20/2004 1Z9952220245265501
199 7/20/2004 1Z9952220245959119
199 7/20/2004 1Z9952220244763322
200 7/21/2004 1Z9952220244788457

I need the data to look like this: (commas or spaces) doesn't matter

199,7/20/2004,1Z9952220245265501,1Z9952220245959119,1Z99522 20244763322
200,7/21/2004,1Z9952220244788457



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
colating multi rows of data into single rows - no to pivot tables! UKMAN Excel Worksheet Functions 4 March 12th 10 04:11 PM
Auto extract data & inserts rows additional rows automatically Meeru Excel Discussion (Misc queries) 3 September 9th 09 01:46 PM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Copy rows of data (eliminating blank rows) from fixed layout Sweepea Excel Discussion (Misc queries) 1 March 13th 07 11:05 PM
Excel 2003 -Rows hidden. Scrolling unhides rows ! How do I stop th Excellent1975 Excel Discussion (Misc queries) 0 June 21st 06 08:01 PM


All times are GMT +1. The time now is 10:14 PM.

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"