Data from multiple cells into one string.

A

Adam

I have data from about seven cells that I need to have combined into one
string when I use data automation from excel to word, is this possible?
 
J

JulieD

Hi Adam

not sure what you mean by "data automation from excel to word" but in excel
you can concatenate the contents of a number of cells,
e.g.
if A1 has Mr
B1 has John
C1 has Smith

=A1 & " " & B1 & " " & C1
will give you
Mr John Smith

so could you combine the 7 cells into one in excel and use that in your link
with word?

hope this helps
Cheers
JulieD

will give the cont
 
G

galimi

Adam,

We can slightly modify the code I provided before

Sub moveToWord()
Set x = CreateObject("Word.Application")
x.Documents.Add
x.Visible = True

For Each cl In Selection

z = z & cstr(cl.value)

Next
x.Selection.TypeText CStr(z)

End Sub

http://HelpExcel.com
 
A

Adam

I got a question: how I do I seperate each cell by commas int his code. Also
is there a way to add comments (or labels) to each cell.

Thanks
 
Top