How to Apply a Word Table Style and Font Using VBA
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 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.
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.
Open your Word document and press Alt + F11 to launch the Visual Basic for Applications (VBA) editor.
In the VBA editor, click on 'Insert' in the top menu and select 'Module' to open a blank coding window.
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'.
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.

Clear Direct Formatting Overrides in the Document
Clear localized direct formatting that prevents your custom table style from dictating the font.
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. Open Your Document in WPS Writer: Launch WPS Office and open your Word document to begin formatting.
- 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. Apply Custom Table Styles: Navigate to 'Table Style' to quickly apply, modify, or create new custom styles tailored to your document's needs.
- 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.

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.




