Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Previously functional code doesn't work properly anymore 68Monkey Word VBA 3 09-25-2018 06:08 PM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Word for Mac doesn't open quickly anymore Neil Turkington Word 0 02-16-2016 09:19 AM
Excel, Word, PowerPoint, Outlook does work anymore Henk52 Office 4 09-08-2015 06:14 PM
macros used to work in all Word.docx> not anymore? Gardener Word 12 12-31-2011 06:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft