Apply First Table Formatting to All Tables in a Word Document with One Click

If you are working in a Word document that contains a large number of tables, and you want to apply same formatting (such as Color, Size, weight and alignment etc.) to all the tables, you would normally have to go to each table one by one, changing the font, colors, weight, and alignment etc. this process not only takes up valuable time but also increases the chances of errors. In this blog post, I will explain how to apply first table formatting to all tables in a word document with one Click using VBA Coded Macros.

By using the power of VBA Coded Macros, you can significantly reduce the time and effort required to format multiple tables within your document.

The following steps illustrate how to replicate the formatting of the first table across all tables within a Microsoft Word document, employing Macros and VBA Code

  1. Open VBA Editor By Pressing ALT + F11 , when VBA Editor Opens Up from the menu Click on insert then select Module as Shown Bellow.
  1. Past the following code inside the module.
Sub ApplyFistTblFormattingToAllTbls()
    Dim myTable As Table
    ActiveDocument.Tables(1).Rows.Select
    Selection.CopyFormat
    For Each myTable In ActiveDocument.Tables
        myTable.Rows.Select
        Selection.PasteFormat
    Next myTable
End Sub
  1. After pasting the Code, Click on Save icon (or Press CTRL+S ) to Save your Macros (if you want directly run VBA Macros Click on RUN Icon(or press F5)) and close VBA Editor as shown bellow.
VBA Code to Apply first Table formatting to all the tables in a word document with a single click
  1. To test your VBA Macro Press ALT+F8 , this open up Macros Dialog Box containing a list of Macros, from the list select your created Macro and Click on RUN Button as Shown Below.
RUN VBA Code to Apply first table formatting to all the tables in a word document with a single click

After clicking on RUN Button your macro will be executed, and the first table will applied to the rest of tables in a document.

I hope this tutorial will helps you to apply first table formatting to all tables in Word Document in a single click.

If you have any question, suggestion or feedback feel free to contact us using the details provided on our contact us page.

Thank You.

Similar Posts