Change:
Code:
'Paste Table into MS Word (using inserted Bookmarks -> ctrl+shift+F5)
.Bookmarks(BookmarkArray(x)).Range.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=False
.Bookmarks(BookmarkArray(x)).Range.tables(1).autofitbehavior (2)
'This block of comments is my trying to get the line above (autofitbehavior) to work with both pasted tables:
'Set BMRange = .Bookmarks(BookmarkArray(x)).Range
'BMRange.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=False
'.Bookmarks.Add BookmarkArray(x), BMRange
'.Bookmarks(BookmarkArray(x)).Range.Select 'autofitbehavior (2)
to:
Code:
'Paste Table into MS Word & format
With myDoc.Bookmarks(BookmarkArray(x)).Range
.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=False
.MoveEnd wdTable, 1
.Tables(1).AutoFitBehavior (wdAutoFitWindow)
End With
PS: When posting the code at VBAX, please credit this site with the above and provide a link to this thread.
PPS: snb has a long-established reputation, both a VBAX and elsewhere, for posting code that doesn't actually address the user's needs.