Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default q. Using a macro to transfer data from Excel to Word

Does anyone know a good way to use a macro to paste data copied from an
Excel data table into a Word table. The data will always go to the same
location in Word. For example data copied from the Project Desc field in
Excel will always go to the Project Desc field in Word, data copied from the
Project Location field in Excel will always go to the Project Location field
in Word, etc..

I have advanced knowledge of using macros to move data around in Excel, but
know very little about how to place it into word.

Any help would be greatly appreciated.

David



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default q. Using a macro to transfer data from Excel to Word

Try this:

http://www.erlandsendata.no/english/...olecontrolword


"David" wrote in message
...
Does anyone know a good way to use a macro to paste data copied from an
Excel data table into a Word table. The data will always go to the same
location in Word. For example data copied from the Project Desc field in
Excel will always go to the Project Desc field in Word, data copied from

the
Project Location field in Excel will always go to the Project Location

field
in Word, etc..

I have advanced knowledge of using macros to move data around in Excel,

but
know very little about how to place it into word.

Any help would be greatly appreciated.

David





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default q. Using a macro to transfer data from Excel to Word

Is there some reason you can't (or don't want to) link the
Word table to the Excel file? Would make it so simple...

If not, I would think it would work best to write and run
the macro from Word, rather than Excel. Put a reference
to the Excel object library in your Word project and then
use an object variable to hold an Excel session:

Dim XLApp as Excel.Application

Set XLApp = New Excel.Application
XLApp.Workbooks.Open "Path\Filename.xls"

Now you can use all your Excel knowledge to access the
data in your file by referring everything to XLApp - for
example to assign the value of a cell to a variable MyVar
you would say MyVar = XLApp.Sheets(Sheetname).Range
(Celladdress).value.

Then you would need to assign it to the table in Word
using the Word Object model. For that, the Object
Browser, WOrd Help, online help via MSDN and the Word
newsgroup can help you with the details...


-----Original Message-----
Does anyone know a good way to use a macro to paste data

copied from an
Excel data table into a Word table. The data will always

go to the same
location in Word. For example data copied from the

Project Desc field in
Excel will always go to the Project Desc field in Word,

data copied from the
Project Location field in Excel will always go to the

Project Location field
in Word, etc..

I have advanced knowledge of using macros to move data

around in Excel, but
know very little about how to place it into word.

Any help would be greatly appreciated.

David



.

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
word to excel data transfer help vandy Excel Discussion (Misc queries) 0 February 18th 10 06:42 PM
how can you transfer data from excel to MS word? How do I creat Multiple Personal Folders Excel Discussion (Misc queries) 1 January 2nd 08 03:38 PM
transfer of data from Excel to MS Word amateur Excel Discussion (Misc queries) 2 February 3rd 05 06:48 PM
Transfer Excel data to Word Davwe[_3_] Excel Programming 1 October 20th 03 08:13 PM
Transfer data from EXCEL to WORD Robin Clay[_3_] Excel Programming 0 October 15th 03 01:54 PM


All times are GMT +1. The time now is 07:34 AM.

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"