View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2185_] Rick Rothstein \(MVP - VB\)[_2185_] is offline
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