VBA & Macro Problems

Change Excel Footer Font Size with VBA Without Removing Text

Steve KSteve K Nov 14, 2026 869 views

Question details

Change the font size of existing Excel footer text using VBA without removing its content.

Change Excel Footer Font Size with VBA Without Removing Text
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet has existing text in its left, center, and right footers that must remain in place when the font size changes.
Observed behavior
Assigning a font-size property to a footer can produce runtime error 424, while replacing the footer string can erase its existing text.
Before you start

Open the workbook and select the worksheet whose footers you want to change. Check which footer sections are in use and decide on the desired point size; the example below uses 8 points.

Solution 1Recommended

Prefix Existing Excel Footers with a VBA Font-Size Code

Use Excel's footer formatting code to set an initial font size while retaining the existing footer strings.

Excel's PageSetup footer properties are strings, not objects with a FontSize property. Prefixing a footer with &8 sets an initial size of 8 points without replacing its existing text or field codes.

A font-size code already present later in a footer can override the prefixed size for the text that follows it. Review the footer's existing formatting codes if the whole footer does not appear at the desired size.

1
Open the VBA editor

In Excel, select Developer > Visual Basic, then choose Insert > Module.

2
Add the macro

Paste the following code into the module: Sub ChangeFooterSize() With ActiveSheet.PageSetup .LeftFooter = "&8" & .LeftFooter .CenterFooter = "&8" & .CenterFooter .RightFooter = "&8" & .RightFooter End With End Sub

3
Run the macro

Return to the intended worksheet, select Developer > Macros, choose ChangeFooterSize, and select Run. Remove any assignment lines for footer sections you do not want to change.

4
Check the result

Open File > Print to preview the footers. If text still has a different size, inspect the footer for later font-size codes and adjust them as needed.

Prefix Existing Excel Footers with a VBA Font-Size Code
Save the macro if needed: To keep the VBA code in the workbook, use File > Save As and select Excel Macro-Enabled Workbook (.xlsm). Running the macro repeatedly adds another size code to each included footer.
Free Microsoft Office alternative

Edit Spreadsheet Footers with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheet files. Open compatible Excel workbooks and adjust footer content in WPS Spreadsheets; WPS does not fix Excel's VBA errors.

Work with spreadsheet headers and footers in WPS SpreadsheetsCompatible with Microsoft Excel formats such as XLSXFamiliar spreadsheet interface for an easier transition from OfficeFree and lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does .LeftFooter.FontSize cause error 424?

PageSetup.LeftFooter is a string property, not a footer object with a FontSize property. Assign a formatted string to .LeftFooter instead.

How do I change only the center footer?

In the VBA module, keep only .CenterFooter = "&8" & .CenterFooter inside the With ActiveSheet.PageSetup block.

Will the macro preserve page numbers and other footer fields?

The macro retains the existing footer string, including field codes such as &P for a page number. Check File > Print afterward to confirm the displayed result.

Why is some footer text still a different size?

A font-size code later in the existing footer string can override the prefixed &8 code. Inspect the existing footer formatting and adjust any later size codes.