View Single Post
 
Old 01-03-2020, 10:12 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I assume you are running the macro in Excel, in which case

Code:
Dim wd As Object
Dim oRng As Object
Dim oTable As Object
Dim wsRepCom As Worksheet
    Set wsRepCom = ActiveSheet
    On Error Resume Next
    Set wd = GetObject(, "Word.Application")
    On Error GoTo 0
    wsRepCom.Range("Table3").Copy
    Set oRng = wd.activedocument.Bookmarks("Table3").Range
    oRng.PasteExcelTable False, False, True
    Set oTable = oRng.Tables(1)
    With oTable
        .AutoFitBehavior 1
        .Range.ParagraphFormat.SpaceAfter = 6
    End With
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote