Office Settings & Configuration

How to Make AutoFit Column Width the Default in Excel

Aamir Naveed AkramAamir Naveed Akram Nov 3, 2026 869 views

Question details

The user is looking for a way to set AutoFit Column Width as the permanent default behavior for all worksheets and workbooks in Excel.

How to Make AutoFit Column Width the Default in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Formatting large datasets where columns need to automatically adjust to fit varying text lengths without requiring manual intervention every time data is entered.
Observed behavior
Excel does not provide a built-in application-level setting to make AutoFit Column Width the permanent default, requiring users to repeatedly manually adjust columns.
Before you start

Since Microsoft Excel lacks a native toggle to permanently enable AutoFit for all new workbooks, you will need to rely on alternative methods such as creating custom workbook templates, utilizing quick ribbon tools, or applying VBA macros to achieve an automated effect.

Solution 1Recommended

Use a VBA Macro to Automatically AutoFit Columns

Implement a simple VBA script to automatically adjust column widths whenever data is entered or changed in a worksheet.

While there is no native setting, a VBA macro is the closest way to achieve a default AutoFit behavior. By adding a specific script to a worksheet, columns will instantly resize themselves as soon as you type and press Enter.

1
Open the VBA Editor

Right-click on the sheet tab at the bottom of your Excel window (e.g., Sheet1) and select 'View Code' from the context menu.

2
Insert the AutoFit Code

In the code window that appears, change the first dropdown from '(General)' to 'Worksheet'. Then, paste the following code between the Private Sub and End Sub lines: 'Cells.EntireColumn.AutoFit'.

3
Save the Workbook as Macro-Enabled

Close the VBA editor. To keep this functionality, save your file as an Excel Macro-Enabled Workbook (.xlsm).

Use a VBA Macro to Automatically AutoFit Columns
Macro Limitations: This method requires macros to be enabled and only applies to the specific worksheet where the code was added. For global use, you must save it in your Personal Macro Workbook.
Seamless Spreadsheet Formatting

Manage Data Easily with WPS Spreadsheet

WPS Spreadsheet provides powerful formatting tools, including quick AutoFit capabilities and customizable templates. It is an excellent, lightweight alternative to handle complex datasets with ease.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your dataset in WPS Spreadsheet.
  2. 2. Select Your Columns: Highlight the columns you wish to format or click the top-left corner to select the entire worksheet.
  3. 3. Apply AutoFit Instantly: Go to the Home tab, click the 'Rows and Columns' icon, and choose 'AutoFit Columns', or simply double-click the column header boundaries.
Fully compatible with Microsoft Excel formats (.xlsx, .xlsm, .csv)Intuitive UI that supports seamless formatting and quick AutoFit shortcutsFree to download and use with lightweight system requirementsBuilt-in support for custom templates and advanced data management
microsoft office alternative - wps office

Frequently Asked Questions

What is the keyboard shortcut for AutoFit Column Width in Excel?

To quickly AutoFit column widths using your keyboard, select the columns you want to adjust and press Alt + H, followed by O, and then I. This sequence activates the Home tab, opens the Format menu, and selects AutoFit Column Width.

Why is my AutoFit not working correctly in Excel?

AutoFit may fail to resize correctly if your cells contain wrapped text or if they are part of a merged cell range. To fix this, highlight the affected area, disable 'Wrap Text' from the Home tab, and ensure no cells are merged before attempting to AutoFit again.

Can I AutoFit both rows and columns at the same time?

Yes. Click the small triangle button in the top-left corner of the worksheet (between column A and row 1) to select all cells. Then, double-click any boundary line between two column letters, and double-click any boundary line between two row numbers.