Hello, I have a workbook with several worksheets and in each of them there is a table I'd like to copy to word (each worksheet consists only on the table) with a VB macro. I've already been able to copy one table but now I want to add the other tables with a "for each... next" command. I'm having trouble in defining a paragraph between tables in word - without the space, each new table will be copied within the former and so on (am I being clear?). Can someone help me? Thank you. The part of the code where I am having issues: For Each cntpy In cntpies
With WordApp.Selection
.Collapse Direction:=0
.InsertBreak Type:=7
End With
'Copy Range from Excel
Worksheets("T." & cntpy).Activate
Worksheets("T." & cntpy).Range("A1:J1").Select
Worksheets("T." & cntpy).Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
'Paste Table into Word
myDoc.Paragraphs(1).Range.PasteExcelTable _
LinkedToExcel:=False, _
WordFormatting:=False, _
RTF:=False
'Autofit Table so it fits inside Word Document
Set WordTable = myDoc.Tables(1)
WordTable.AutoFitBehavior (wdAutoFitWindow)
Next
With WordApp.Selection
.Collapse Direction:=0
.InsertBreak Type:=7
End With
'Copy Range from Excel
Worksheets("T." & cntpy).Activate
Worksheets("T." & cntpy).Range("A1:J1").Select
Worksheets("T." & cntpy).Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
'Paste Table into Word
myDoc.Paragraphs(1).Range.PasteExcelTable _
LinkedToExcel:=False, _
WordFormatting:=False, _
RTF:=False
'Autofit Table so it fits inside Word Document
Set WordTable = myDoc.Tables(1)
WordTable.AutoFitBehavior (wdAutoFitWindow)
Next