logo
search
Formatting Issues

Can Excel Conditional Formatting Change Font Size or Row Height?

Rana GarciaRana Garcia Sep 28, 2026 871 views

Question details

The user wants to know if they can automatically change font size or row height using conditional formatting in Excel based on a specific cell value.

Conditional Formatting Excel
Product
Excel
Device & OS
not provided
Scenario
Formatting a report where rows need to automatically shrink or adjust their font size when a specific condition (such as a status changing to 'Completed') is met.
Observed behavior
Native Excel conditional formatting supports changing visual properties like font color, fill, and borders, but lacks the ability to alter layout dimensions like font size or row height.
Before you start

Ensure your workbook is saved as a Macro-Enabled Workbook (.xlsm) if you plan to use VBA scripts, as standard conditional formatting cannot adjust physical cell dimensions.

Solution 1Recommended

Use VBA to Change Row Height and Font Size

Since native conditional formatting doesn't support layout size changes, a VBA macro is required to automate row height and font size adjustments based on cell values.

VBA (Visual Basic for Applications) can detect when a cell's value changes and automatically trigger formatting updates across the sheet, overriding the limitations of standard conditional formatting rules.

1
Open the VBA Editor

Press 'Alt + F11' on your keyboard to open the VBA Editor in Excel.

2
Access Worksheet Code

In the Project Explorer panel on the left, right-click the name of the sheet where you want this formatting applied and select 'View Code'.

3
Add a Worksheet_Change Event

Paste a 'Worksheet_Change' script that targets the specific column (e.g., Column E). Program the script to check if the target cell's value equals your condition (e.g., 'Completed').

4
Set Font Size and Row Height

Add commands within your script such as 'Target.EntireRow.RowHeight = 15' and 'Target.Font.Size = 8' to apply the formatting changes when the condition is met.

5
Save as Macro-Enabled

Go to File > Save As, and change the file format to 'Excel Macro-Enabled Workbook (*.xlsm)' to ensure your automation works.

Conditional Formatting Excel
Enable Macros: Macros must be enabled in your Excel Trust Center settings for this automation script to run automatically when editing the file.
Advanced Formatting in WPS Spreadsheet

Use WPS Spreadsheet to Automate and Format Data

WPS Spreadsheet offers powerful conditional formatting tools and comprehensive VBA support, allowing you to dynamically manage font sizes, row heights, and visual styles easily.

  1. 1. Open Your Spreadsheet: Launch WPS Spreadsheet and open your existing Excel workbook.
  2. 2. Apply Visual Rules: To apply visual highlights, select your data range and click 'Conditional Formatting' under the 'Home' tab.
  3. 3. Automate Physical Sizes via VBA: To automate layout sizes, go to the 'Tools' tab and click 'Macro' > 'Visual Basic Editor' to insert your dynamic resizing script.
  4. 4. Save and Execute: Save your document as a macro-enabled file (.xlsm) so the row heights and font sizes update automatically as cell values change.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) macro-enabled formats.Robust built-in Conditional Formatting for highlights, data bars, and color scales.VBA macro support in WPS Pro to automate row height and font size changes seamlessly.Lightweight, fast, and free to download with a highly familiar user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why is font size grayed out in Excel Conditional Formatting?

Excel restricts font size and font type changes in conditional formatting to prevent unexpected shifts in row heights and overall spreadsheet layout. These layout shifts can drastically disrupt data alignment and make the spreadsheet difficult to read if triggered continuously.

Can Office Scripts change row height on Excel for Web?

Yes, if you are using Excel for the Web with an enterprise or business license, you can write TypeScript-based Office Scripts to automate row height and font size changes, serving as a modern alternative to VBA macros.

Is it possible to use an Excel formula to change cell size?

No, Excel formulas can only calculate and return values or text strings to the cell they reside in. They cannot change physical formatting, row height, column width, or the styles of any cells.