Data from multiple cells into one string.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top