ElyxAI
pivot tables

How to How to Preserve Column Width on Pivot Table Refresh in Excel

Excel 2016Excel 2019Excel 365Excel 2021

Learn how to preserve column widths when refreshing pivot tables in Excel, preventing automatic resizing that disrupts formatting. This tutorial covers multiple methods including PivotTable options, VBA automation, and manual settings to maintain your custom layout consistently across data updates.

Why This Matters

Preserving column widths saves time on formatting after each refresh and maintains professional presentation standards in reports and dashboards.

Prerequisites

  • Basic understanding of pivot tables in Excel
  • Access to a workbook with an existing pivot table
  • Knowledge of PivotTable Design tab navigation

Step-by-Step Instructions

1

Select Your Pivot Table

Click any cell within your pivot table to activate it. The PivotTable Tools will appear in the ribbon with Design and Analyze tabs available.

2

Access PivotTable Options

Go to PivotTable Tools > Analyze tab > Options (or PivotTable Options in older versions) to open the settings dialog.

3

Navigate to Layout & Format

In the PivotTable Options dialog, click the Layout & Format tab to access formatting preservation settings.

4

Enable Column Width Preservation

Check the box labeled 'Preserve cell formatting on update' or 'Autofit column widths' depending on your Excel version to protect custom widths.

5

Apply and Test

Click OK to save settings, then refresh your pivot table (right-click > Refresh) to verify column widths remain unchanged.

Alternative Methods

VBA Macro Automation

Create a VBA macro that saves column widths before refresh and restores them after using the With ActiveSheet.PivotTables method.

Manual Column Lock (Workaround)

Manually adjust columns, then avoid using AutoFit by disabling automatic resizing in File > Options > Proofing.

Use Data Model Instead

Build your pivot table using the Data Model and Power Pivot, which handle formatting more consistently across refreshes.

Tips & Tricks

  • Set column widths before configuring the preservation option to ensure your custom sizes are locked in.
  • Test the refresh function on a copy of your workbook first to confirm settings work as expected.
  • Use consistent column width values (e.g., 15 for text, 12 for numbers) for professional appearance.
  • Combine this setting with 'Preserve cell formatting' for comprehensive formatting retention.

Pro Tips

  • Store width settings as a template by saving the workbook as .potx for reuse across multiple projects.
  • Automate width preservation with event-driven VBA using Workbook_Open to reapply widths without user intervention.
  • Combine with conditional formatting rules that persist across refreshes for enhanced data visualization.
  • Use named ranges with frozen panes to maintain layout integrity when pivot table structure changes.

Troubleshooting

Column widths still reset after refresh despite enabling preservation.

Verify AutoFit is disabled (PivotTable Tools > Design > AutoFit Column Width should be unchecked). Also confirm 'Preserve cell formatting' is checked in both Layout & Format and Data tabs.

New columns added during refresh are not formatted with preserved widths.

Apply column width preservation after the data source expands, or use VBA to dynamically adjust widths for all columns including new ones.

Settings revert after closing and reopening the workbook.

Save the workbook in .xlsm format with a macro that reapplies widths on open, or manually reapply the preservation setting after each save.

Frequently Asked Questions

Why do my column widths keep resizing when I refresh the pivot table?
Excel's default behavior resets formatting unless you explicitly enable preservation. Go to PivotTable Options > Layout & Format and check 'Preserve cell formatting on update' to prevent this automatic resizing.
Does preserving column width affect pivot table performance?
No, enabling this setting has negligible impact on performance. It simply tells Excel to retain your custom widths rather than recalculate them automatically.
Can I use VBA to automate width preservation?
Yes, you can write a macro that stores column widths before refresh and restores them after using a loop through the Columns collection and storing Width values in variables.
Will this setting work if I add new fields to the pivot table?
The setting applies to existing columns; new fields added will use Excel's default width, so you may need to manually adjust new columns after adding fields.
What's the difference between 'Preserve cell formatting' and 'Autofit column widths'?
Preserve cell formatting keeps your column widths and other formatting; Autofit adjusts widths to fit content. These options work opposite to each other, so use only one.

This was one task. ElyxAI handles hundreds.

Sign up