Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copying from word and pasting into excel
I'm trying to create code for excel that will allow me to open
series of word documents, copy certain rows from tables in thos docs, and paste them into the excel worksheet I know how to open word from excel, but my knowledge ends there... Can someone please help me, by explaining how to open a word doc, cop a table/row, and paste it into excel Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copying from word and pasting into excel
Hello I hope this macro helps you Sub importValuesFromWordTables() 'test with Excel2002 'Activate Microsoft Word xx.x Object Library ' Dim WordApp As Word.Application Dim WordDoc As Word.Document Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = False 'Word not visisble during operation Set WordDoc = WordApp.Documents.Open("C:\myDoc.doc") 'open Word doc 'copy third row of the first Word table WordDoc.Tables(1).Rows(3).Range.Copy 'paste in Excel Range("A1").PasteSpecial xlPasteValues WordDoc.Close 'close Word doc WordApp.Quit 'close Word session End Sub regards , michel -- michelxld ------------------------------------------------------------------------ michelxld's Profile: http://www.excelforum.com/member.php...o&userid=17367 View this thread: http://www.excelforum.com/showthread...hreadid=398449 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying a doc from Excel and pasting it into Word. | New Users to Excel | |||
Copying Color-Coded Text and Pasting it in that format to Word | Excel Discussion (Misc queries) | |||
copying/pasting accurately from a Word table (carriage returns) | Excel Discussion (Misc queries) | |||
Copying from Excel - pasting in Publisher | Excel Discussion (Misc queries) | |||
Excel - Word: Problems copying/pasting shapes | Excel Programming |