Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Putting text together from 3 cells

Hi i have 3 cells a1 a2 a3 all with about 2 sentences of data in, i
want to take all that data and put it in one cell, however i wish to
seperate each piece of data from each cell with a carrige line space
and title like below

go from this :

cell a1: helloe i am the data in a1
cell a2: hello i am the data in a2
cell a3: hello i am the data in a3

to this

cell b1: a1 data
hello i am the data in a1

a2 data
hello i am the data in a2

a3 data
hello i am the data in a3

hope this makes sense, been trying to solve this but cannot get the
line spaces or add the titles to each cell value
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting text together from 3 cells

Although you posted in the programming newsgroup, you can do what you want
with a worksheet formula...

="a1 data"&CHAR(10)&A1&CHAR(10)&CHAR(10)&"a2
data"&CHAR(10)&A2&CHAR(10)&CHAR(10)&"a3 data"&CHAR(10)&A3

Rick


wrote in message
...
Hi i have 3 cells a1 a2 a3 all with about 2 sentences of data in, i
want to take all that data and put it in one cell, however i wish to
seperate each piece of data from each cell with a carrige line space
and title like below

go from this :

cell a1: helloe i am the data in a1
cell a2: hello i am the data in a2
cell a3: hello i am the data in a3

to this

cell b1: a1 data
hello i am the data in a1

a2 data
hello i am the data in a2

a3 data
hello i am the data in a3

hope this makes sense, been trying to solve this but cannot get the
line spaces or add the titles to each cell value


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Putting text together from 3 cells

in B2:

=A1&CHR(10)&A2

then copy down

or simply:

=A1&CHR(10)&A2&CHR(10)&A3
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Putting text together from 3 cells

On Jun 26, 9:42*am, "Rick Rothstein \(MVP - VB\)"
wrote:
Although you posted in the programming newsgroup, you can do what you want
with a worksheet formula...

="a1 data"&CHAR(10)&A1&CHAR(10)&CHAR(10)&"a2
data"&CHAR(10)&A2&CHAR(10)&CHAR(10)&"a3 data"&CHAR(10)&A3

Rick

wrote in message

...



Hi i have 3 cells a1 a2 a3 all with about 2 sentences of data in, i
want to take all that data and put it in one cell, however i wish to
seperate each piece of data from each cell with a carrige line space
and title like below


go from this :


cell a1: helloe i am the data in a1
cell a2: hello i am the data in a2
cell a3: hello i am the data in a3


to this


cell b1: a1 data
* * *hello i am the data in a1


* * *a2 data
* * *hello i am the data in a2


* * *a3 data
* * *hello i am the data in a3


hope this makes sense, been trying to solve this but cannot get the
line spaces or add the titles to each cell value- Hide quoted text -


- Show quoted text -


thanks,

I wanted to know if i could do it with a macro as the 3 cells i wish
to put together could be any where, i want to try and click on the
first of the 3 cells, press the button and them the cells join
together on another part of the spreadsheet,
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting text together from 3 cells

And if you needed the code in a macro...

Sub CombineText()
With Worksheets("Sheet1")
.Range("B1").Cells.WrapText = True
.Range("B1").Value = "a1 data" & vbLf & .Range("A1") & _
vbLf & vbLf & _
"a2 data" & vbLf & .Range("A2") & _
vbLf & vbLf & _
"a3 data" & vbLf & .Range("A3")
End With
End Sub

By the way, notice that I take care of formatting B1 to wrap its text in the
code... don't forget that if you use my worksheet formula, you have to do
that manually.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Although you posted in the programming newsgroup, you can do what you want
with a worksheet formula...

="a1 data"&CHAR(10)&A1&CHAR(10)&CHAR(10)&"a2
data"&CHAR(10)&A2&CHAR(10)&CHAR(10)&"a3 data"&CHAR(10)&A3

Rick


wrote in message
...
Hi i have 3 cells a1 a2 a3 all with about 2 sentences of data in, i
want to take all that data and put it in one cell, however i wish to
seperate each piece of data from each cell with a carrige line space
and title like below

go from this :

cell a1: helloe i am the data in a1
cell a2: hello i am the data in a2
cell a3: hello i am the data in a3

to this

cell b1: a1 data
hello i am the data in a1

a2 data
hello i am the data in a2

a3 data
hello i am the data in a3

hope this makes sense, been trying to solve this but cannot get the
line spaces or add the titles to each cell value





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting text together from 3 cells

This code will put the text from the active cell and the two cells below it
into B1 on Sheet1 (you can change destination cell in the With statement)..

Sub CombineText()
With Worksheets("Sheet1").Range("B1")
.Cells.WrapText = True
.Value = "a1 data" & vbLf & ActiveCell.Value & _
vbLf & vbLf & _
"a2 data" & vbLf & ActiveCell.Offset(1, 0).Value & _
vbLf & vbLf & _
"a3 data" & vbLf & ActiveCell.Offset(2, 0).Value
End With
End Sub

Rick


wrote in message
...
On Jun 26, 9:42 am, "Rick Rothstein \(MVP - VB\)"
wrote:
Although you posted in the programming newsgroup, you can do what you want
with a worksheet formula...

="a1 data"&CHAR(10)&A1&CHAR(10)&CHAR(10)&"a2
data"&CHAR(10)&A2&CHAR(10)&CHAR(10)&"a3 data"&CHAR(10)&A3

Rick

wrote in message

...



Hi i have 3 cells a1 a2 a3 all with about 2 sentences of data in, i
want to take all that data and put it in one cell, however i wish to
seperate each piece of data from each cell with a carrige line space
and title like below


go from this :


cell a1: helloe i am the data in a1
cell a2: hello i am the data in a2
cell a3: hello i am the data in a3


to this


cell b1: a1 data
hello i am the data in a1


a2 data
hello i am the data in a2


a3 data
hello i am the data in a3


hope this makes sense, been trying to solve this but cannot get the
line spaces or add the titles to each cell value- Hide quoted text -


- Show quoted text -


thanks,

I wanted to know if i could do it with a macro as the 3 cells i wish
to put together could be any where, i want to try and click on the
first of the 3 cells, press the button and them the cells join
together on another part of the spreadsheet,

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
taking numbers in vertical cells putting them in horizontal cells jhawk22 Excel Worksheet Functions 4 April 28th 10 08:37 PM
Putting text into graph Kirsty Charts and Charting in Excel 3 February 24th 09 08:55 PM
Putting text in a column based on variable text from another colum Jacky D. Excel Discussion (Misc queries) 1 December 16th 04 06:09 PM
copying text from one group of cells and putting them in a table? cakonopka[_5_] Excel Programming 0 February 3rd 04 11:21 AM
Putting text in a cell BWGames Excel Programming 2 December 30th 03 05:08 PM


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

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"