View Single Post
 
Old 02-09-2021, 10:33 PM
Wild Bee Wild Bee is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2021
Posts: 7
Wild Bee is on a distinguished road
Talking Thankyou!!

You awesome person!! Thank you! The single one worked awesomely. I'll try the other one, but even just the first one is fantastic.

I need to learn how to write VBA..
LOL


Quote:
Originally Posted by gmayor View Post
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
Reply With Quote