Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Adam
 
Posts: n/a
Default Data from multiple cells into one string.

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?
  #2   Report Post  
JulieD
 
Posts: n/a
Default

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" wrote in message
...
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?



  #3   Report Post  
galimi
 
Posts: n/a
Default

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

"Adam" wrote:

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?

  #4   Report Post  
Adam
 
Posts: n/a
Default

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

"galimi" wrote:

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

"Adam" wrote:

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?

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
Combining data (numeric format) in multiple cells into one cell (t GNAC SID Excel Discussion (Misc queries) 2 February 7th 05 04:09 PM
How do I center data across multiple cells in excel without mergi. lmark Excel Discussion (Misc queries) 6 January 27th 05 05:55 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM


All times are GMT +1. The time now is 05:31 AM.

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

About Us

"It's about Microsoft Excel"