Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
word to excel data transfer help | Excel Discussion (Misc queries) | |||
how can you transfer data from excel to MS word? | Excel Discussion (Misc queries) | |||
transfer of data from Excel to MS Word | Excel Discussion (Misc queries) | |||
Transfer Excel data to Word | Excel Programming | |||
Transfer data from EXCEL to WORD | Excel Programming |