View Single Post
 
Old 07-16-2025, 06:47 PM
Flo78000 Flo78000 is offline Windows 11 Office 2021
Novice
 
Join Date: Jul 2025
Posts: 1
Flo78000 is on a distinguished road
Default VBA macro doesn’t work anymore in Word (Office 365)

Code:
Sub tableau2col()
'
' tableau2col Macro
'
'
    Selection.ConvertToTable Separator:=wdSeparateByParagraphs, NumColumns:=1, _
         NumRows:=7, AutoFitBehavior:=wdAutoFitFixed
    With Selection.Tables(1)
        If .Style <> "Table Grid" Then
            .Style = "Table Grid"
        End If
        .ApplyStyleHeadingRows = True
        .ApplyStyleLastRow = False
        .ApplyStyleFirstColumn = True
        .ApplyStyleLastColumn = False
        .ApplyStyleRowBands = True
        .ApplyStyleColumnBands = False
    End With
    Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=198.2, RulerStyle:= _
        wdAdjustNone
    Selection.SelectColumn
    Selection.Copy
    Selection.PasteAndFormat (wdPasteDefault)
    Selection.Font.Hidden = wdToggle
End Sub

Last edited by macropod; 07-16-2025 at 11:12 PM. Reason: Added code tags for code formatting
Reply With Quote