Hello
I was after a little help if possible.
The macro I am trying to make will take data from the word file “606letter practice” and then update the excel file “practice pocva”.
The word file is a template letter that gets updated with new generated information. What I want it to do is take selected information and then update the next available line.
In the word file, table 2, row 1 column 2, data should be inputted in the next available line on excel file column 1
Table 1 row 3 column 3 – inputted to column 2 excel
table 3 row 2 column 1- input column 3 excel with the word “list”
table 3 row 5 columm 1 input column 3 excel with the word “ISAC”
table 3 row 8 column 1 input column 3 excel with the word “ISAA”
I hope this all makes sense , any questions please ask, and any help really would be appreciated. I have attached a mock up with a before and after.
kind regards
Joe
Not sure that I fully understood but may the code below might help. You will need to make a reference to Word (tools -references) , have the Word Document open and Excel open on the correct sheet.
Sub Test() Dim WordApp As Word.Application Set WordApp = GetObject(, "Word.Application") Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = WordApp.ActiveDocument.Tables(2).Cell(1, 2) Cells(Rows.Count, 1).End(xlUp).Offset(0, 1) = WordApp.ActiveDocument.Tables(1).Cell(3, 3) Cells(Rows.Count, 1).End(xlUp).Offset(0, 2) = WordApp.ActiveDocument.Tables(3).Cell(2, 1) Cells(Rows.Count, 1).End(xlUp).Offset(0, 3) = WordApp.ActiveDocument.Tables(3).Cell(5, 1) Set WordApp = Nothing End Sub
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks