How to Make AutoFit Column Width the Default in Excel
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.

- 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.
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.
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.
Right-click on the sheet tab at the bottom of your Excel window (e.g., Sheet1) and select 'View Code' from the context menu.
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'.
Close the VBA editor. To keep this functionality, save your file as an Excel Macro-Enabled Workbook (.xlsm).

Create a Custom Default Workbook Template
Set up a blank template with pre-adjusted column widths and save it in the XLSTART folder so new workbooks open with these settings.
Use the Built-In Ribbon Tool or Shortcuts
Quickly apply AutoFit manually whenever needed using Excel's Home tab or double-click shortcuts.
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. Open WPS Spreadsheet: Launch WPS Office and open your dataset in WPS Spreadsheet.
- 2. Select Your Columns: Highlight the columns you wish to format or click the top-left corner to select the entire worksheet.
- 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.

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.




