A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Merge contents of cells and insert line space



 
 
Thread Tools Display Modes
  #1  
Old June 9th 07, 12:34 AM posted to microsoft.public.excel.worksheet.functions
Craig
external usenet poster
 
Posts: 208
Default Merge contents of cells and insert line space

Hi,
I would like via a function (preferred) or macro, to combine several
adjacent cells into a single cell, but separate the contents with a line
space.

I am familiar with the concatenate function, but I am unsure how to insert a
line space between the contents of each cell. Any help much appreciated.
Craig
Ads
  #2  
Old June 9th 07, 12:57 AM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 9,221
Default Merge contents of cells and insert line space

One way

Assuming source text in A1:C1, then in D1:
=A1&CHAR(10)&B1&CHAR(10)&C1
Format D1 to wrap text. Copy down as required
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Craig" wrote:
> Hi,
> I would like via a function (preferred) or macro, to combine several
> adjacent cells into a single cell, but separate the contents with a line
> space.
>
> I am familiar with the concatenate function, but I am unsure how to insert a
> line space between the contents of each cell. Any help much appreciated.
> Craig

  #3  
Old June 9th 07, 01:02 AM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,718
Default Merge contents of cells and insert line space

=CONCATENATE(A1," ",B1," ",C1)


"Craig" wrote:

> Hi,
> I would like via a function (preferred) or macro, to combine several
> adjacent cells into a single cell, but separate the contents with a line
> space.
>
> I am familiar with the concatenate function, but I am unsure how to insert a
> line space between the contents of each cell. Any help much appreciated.
> Craig

  #4  
Old June 9th 07, 01:15 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 22,912
Default Merge contents of cells and insert line space

Craig

What is a line space? A linefeed or just a space between words?

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 = Chr(10) 'for line feed
' w = InputBox("Enter the Type of De-limiter Desired") for your choice
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 MS Excel MVP

On Fri, 8 Jun 2007 16:34:01 -0700, Craig >
wrote:

>Hi,
>I would like via a function (preferred) or macro, to combine several
>adjacent cells into a single cell, but separate the contents with a line
>space.
>
>I am familiar with the concatenate function, but I am unsure how to insert a
>line space between the contents of each cell. Any help much appreciated.
>Craig


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I merge 2 cells to 1 when contents are numbers AND retain decimals huruta Excel Discussion (Misc queries) 3 January 28th 06 07:37 PM
How do I merge 2 cells to 1 when contents are numbers traceyclarity Excel Discussion (Misc queries) 3 January 27th 06 03:54 PM
How do I merge two cells but keeping all contents in Excell? gysl Excel Discussion (Misc queries) 2 November 1st 05 07:16 AM
Excel should have the option to merge contents when merging cells. Ceiling Tile 01 Excel Discussion (Misc queries) 2 August 31st 05 11:03 PM
How do I merge the contents (separated by a comma) of 300+ cells? elliott Excel Discussion (Misc queries) 3 May 10th 05 08:39 PM


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


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