Results 1 to 4 of 4

Thread: VBA coding for Word table to combine macros and left align first column only

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Oct 2019
    Posts
    2
    Location

    VBA coding for Word table to combine macros and left align first column only

    Looking for some help please with this coding below, they work seperately, but cannot workout how to piece them together to be incorporated into one button. This is to paste an different excel tables into a word template table placeholder. Thanks

    Sub CGPasteTable()
        Selection.PasteSpecial Link:=False, DataType:=wdPasteRTF, Placement:= _
        wdInLine, DisplayAsIcon:=False
    End Sub
     
    With Selection
        .Tables(1).Select
        .Style = ActiveDocument.Styles("CG Table Text")
        .Tables(1).AutoFitBehavior (wdAutoFitContent)
        .Tables(1).AutoFitBehavior (wdAutoFitWindow)
        .ParagraphFormat.Alignment = wdAlignParagraphRight
        With .Cells
            .VerticalAlignment = wdCellAlignVerticalCenter
            .Height = CentimetersToPoints(0.44)
        End With
        End With
    End Sub
     
    Sub CGleftalignfirstcolumn()
        With Selection
            .SelectColumn
            .ParagraphFormat.Alignment = wdAlignParagraphLeft
        End With
    End Sub
    Last edited by Aussiebear; 03-14-2025 at 04:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •