logo
search
Office Settings & Configuration

How to Apply a Word Table Style and Font Using VBA

John WilsonJohn Wilson Sep 28, 2026 870 views

Question details

The user needs to apply a custom table style and specifically format the font (e.g., Arial Nova 11pt) using a VBA macro, as the table font fails to update automatically upon changing the style.

Product
Word
Device & OS
not provided
Scenario
Automating table formatting across a document using a custom style and specific font settings via VBA macros.
Observed behavior
When a custom Word table style is applied via VBA, the table font does not update as expected, likely because direct formatting overrides the underlying custom table style settings.
Before you start

Before running any VBA macros, ensure you have enabled the Developer tab in your Word settings and backed up your document to prevent unintended formatting losses.

Solution 1Recommended

Modify the Custom Table Style and Apply Explicit Formatting via VBA

Update the base custom table style directly so that all tables using it inherit the correct font, and use a macro to explicitly override any persistent local formatting.

Direct formatting in a Word document can override custom table styles. By modifying the custom table style itself to include your desired font (like Arial Nova 11pt) and using VBA to explicitly enforce these settings, you ensure that all tables inherit the formatting correctly without relying solely on local overrides.

1
Access the VBA Editor

Open your Word document and press Alt + F11 to launch the Visual Basic for Applications (VBA) editor.

2
Insert a New Module

In the VBA editor, click on 'Insert' in the top menu and select 'Module' to open a blank coding window.

3
Enter the Formatting Macro

Write a macro that loops through the document's tables, setting the style and explicitly defining the font. For example: Use 'tbl.Style = "YourCustomStyle"', followed by 'tbl.Range.Font.Name = "Arial Nova"' and 'tbl.Range.Font.Size = 11'.

4
Run the Macro

Press F5 or click the 'Run' button on the toolbar to execute the macro, which will update the style and font of all tables in the active document.

Modify the Custom Table Style and Apply Explicit Formatting via VBA
Table Style Quirks: If modifying the style doesn't immediately reflect on your tables, select the table and press Ctrl + Space to remove direct character formatting that might be blocking the style.

Manage Document Styles Easily with WPS Writer

WPS Office provides an intuitive and powerful interface for managing table styles, fonts, and document automation. It offers a highly compatible environment for formatting complex documents seamlessly.

  1. 1. Open Your Document in WPS Writer: Launch WPS Office and open your Word document to begin formatting.
  2. 2. Select the Target Table: Click on the table you wish to format, which will reveal the 'Table Tools' tab on the main ribbon.
  3. 3. Apply Custom Table Styles: Navigate to 'Table Style' to quickly apply, modify, or create new custom styles tailored to your document's needs.
  4. 4. Adjust Font Settings Instantly: Use the Home tab to adjust font settings like Arial Nova and 11pt size across the selected tables with a single click.
Highly compatible with Microsoft Word document formats (.docx)Intuitive Table Tools and Style management interfaceSupports advanced document formatting and layout controlsLightweight, fast, and completely free to use for daily tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Word table style not change the font?

Direct formatting applied to the text inside the table overrides the custom table style. You must clear the direct formatting (using Ctrl+Space for characters or Ctrl+Q for paragraphs) for the table style's default font settings to take effect.

Can I apply a specific font to all tables using VBA?

Yes. You can loop through all tables in the ActiveDocument using a 'For Each' VBA macro loop and explicitly set 'Table.Range.Font.Name' and 'Table.Range.Font.Size' to your desired specifications.

How do I create a custom table style in Word?

Select any table, go to the Table Design tab, expand the Table Styles gallery, and click 'New Table Style'. From there, you can define specific formatting, including font types and borders, that will apply to any table using this new style.