Hi,
I am trying to copy a data from word to excel ( multiple files)…Now we are able to copy the data from word to excel, but would like to add simple two steps:
1. Transpose (the rightmost cells only) and copy/paste row one in the result sheet. Then the second file will be pasted row 2 an so an.
2.Since we are copying many files( 100 files) from word to excel, would like to delete the previous file from the sheet1 and also get prompt to select the second file ( the new file to copy/paste)
Sample word and excel file attached..The Result tab is the desired result
Below is the code we are now using..
Sub CopyWordTable()
'requires a reference to Word Object Library (Tools - References)
Dim appWord As Word.Application
Dim docWord As Word.Document
Dim strDoc As String
Dim tableWord As Word.Table
'Word document and this Excel workbook are in the same folder
'Table.doc contains a table formatted with various colours, fonts, borders and bullets
strDoc = ThisWorkbook.Path & "\" & "file one.doc"
Set appWord = New Word.Application
appWord.Visible = True
Set docWord = appWord.Documents.Open(strDoc)
'copy first table in document to clipboard
Set tableWord = docWord.Tables(1)
tableWord.Range.Copy
'paste table on worksheet
ActiveSheet.Paste Destination:=ActiveSheet.Range("A2")
docWord.Close
appWord.Quit
Set tableWord = Nothing
Set docWord = Nothing
Set appWord = Nothing
End Sub
Thanks in advance...
Jimmy
Bookmarks