Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a table in Word
I know this is a long shot but is there anybody out there who knows ho
to create a two column table in Word from Excel and then add data int it.. -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a table in Word
This will point you in the right direction, I recorded this macro in word
into "Normal.NewMacros" in the Vb editor. Then with the TestIt macro I call the word macro from excel. In this case word is already open. Sub InsertTable() 'Word Macro ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:= _ 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed With Selection.Tables(1) If .Style < "Table Grid" Then .Style = "Table Grid" End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With End Sub Sub TestIt() 'Excel Macro Set WdApp = Word.Application 'used to say "New Word.Application" when word wasn't open With WdApp '.Documents.Open Filename:="C:\Macro Laden Document.doc" 'if you want to open a document '.Visible = True '.WindowState = xlMaximized '.Activate .Application.Run MacroName:="Normal.NewMacros.InsertTable" End With 'WdApp Set WdApp = Nothing End Sub -- Regards, Rocky McKinley "tonesmcbutt " wrote in message ... I know this is a long shot but is there anybody out there who knows how to create a two column table in Word from Excel and then add data into it... --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a table in Word
Thank you for replying - I will give it a try and let you know how I got
on --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
creating a report from a table, pivot table not suitable | Excel Worksheet Functions | |||
Link table from excel to word using word VBA | Excel Discussion (Misc queries) | |||
Creating a Hyperlink from a Single Word | Links and Linking in Excel |