If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro for word tables to excel
There are lots of posts asking how to write a macro exporting a word
table to excel 2003. This is probably the most simple macro for this task: Sub GetWordTable() Dim wdap As Word.Application Dim wddc As Word.Document Dim wdtbl As Word.Table Set wdap = GetObject(, "word.application") Set wddc = wdap.ActiveDocument Set wdtbl = wddc.Tables(1) wdtbl.Range.Cut ActiveSheet.Paste End Sub |
#2
|
|||
|
|||
Macro for word tables to excel
Simple to the point of silly. How can you, at the Excel end, know that it's
the first table in the active document that you want? And why remove it remove the document rather than copying it? You'll also get poor results if any of the Word cells contains multiple paragraphs. It's also poor programming to mixing early and late binding. wrote in message oups.com... There are lots of posts asking how to write a macro exporting a word table to excel 2003. This is probably the most simple macro for this task: Sub GetWordTable() Dim wdap As Word.Application Dim wddc As Word.Document Dim wdtbl As Word.Table Set wdap = GetObject(, "word.application") Set wddc = wdap.ActiveDocument Set wdtbl = wddc.Tables(1) wdtbl.Range.Cut ActiveSheet.Paste End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
running an Excel macro from MS Access | Rafi | Using Forms | 2 | March 28th, 2006 06:19 PM |
consolidation of tables in excel with text and figures | samenvoegen van sheets | Worksheet Functions | 8 | March 2nd, 2006 03:27 PM |
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER | MEGTOM | New Users | 5 | October 27th, 2005 03:06 AM |
Macro Help In Excel | welshlad | General Discussion | 14 | October 26th, 2005 02:34 PM |
Ctrl+A macro fix for problem in Excel 2003 | David McRitchie | General Discussion | 4 | June 19th, 2004 12:01 PM |