Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello Everybody
I'm really new at using macros (a week or so..) and i am having a few problems creating word tables. What i want to do is : create a word document, copy text from a cell in a excel worksheet into a paragraph in the word document and then copy other cells into a table in the word document. The table is created just fine, but when i try to insert more text outside the table i wont let me. Everything is inserted into the first cell of my word table... Any idea why is this happening? =( Thanks in advance! Sub CreateNewTable() Dim docActive As Document Dim tblNew As Table Dim celTable As Cell Dim intCount As Integer 'Create word document Set docActive = CreateObject("Word.Document") 'Create word table Set tblNew = docActive.Tables.Add( _ Range:=docActive.Range(Start:=0, End:=0), NumRows:=3, _ NumColumns:=4) intCount = 1 'Fill the cells in the table For Each celTable In tblNew.Range.Cells celTable.Range.InsertAfter "Cell " & intCount 'or the ..values from my excel.. intCount = intCount + 1 Next celTable tblNew.AutoFormat ApplyBorders:=True, ApplyFont:=True, ApplyColor:=True 'I want this followint text to be a new paragraph after the table but instead it is inserted inside the Table =( With docActive.ActiveWindow.Selection .TypeParagraph .Font.Name = "Arial" .Font.Size = "22" .Font.Color = RGB(64, 128, 192) .TypeText Text:="Cell Comments In Workbook: " + ActiveWorkbook.Name .TypeParagraph End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
consolidation of tables in excel with text and figures | Excel Worksheet Functions | |||
Copy from WORD to EXCEL using a macro..... | Excel Discussion (Misc queries) | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
Excel macro that opens new MS Word file and pastes data as a pictu | Excel Worksheet Functions | |||
How do I create a macro, that references another excel file ??? | Excel Worksheet Functions |