View Single Post
 
Old 02-09-2021, 09:37 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

How about
Code:
Sub Macro1()
Dim oCell As Cell
Dim oTable As Table
    Set oTable = Selection.Tables(1)
    For Each oCell In oTable.Range.Cells
        With oCell
            .TopPadding = InchesToPoints(0)
            .BottomPadding = InchesToPoints(0)
            .LeftPadding = InchesToPoints(0)
            .RightPadding = InchesToPoints(0)
        End With
    Next oCell
End Sub
or for all the tables
Code:
Sub Macro2()
Dim oCell As Cell
Dim oTable As Table
    For Each oTable In ActiveDocument.Tables
        For Each oCell In oTable.Range.Cells
            With oCell
                .TopPadding = InchesToPoints(0)
                .BottomPadding = InchesToPoints(0)
                .LeftPadding = InchesToPoints(0)
                .RightPadding = InchesToPoints(0)
            End With
        Next oCell
        DoEvents
    Next oTable
End Sub
__________________
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