How to Autofit Whole Sheet in Excel
In this article
Autofitting an entire worksheet in Microsoft Excel adjusts the width of all columns and the height of all rows to perfectly fit their content. This eliminates wasted space and prevents text from being cut off, ensuring your data is readable without manual resizing. To achieve this quickly, you must first select every cell on the sheet before applying the autofit command.
What You'll Need
- A computer with Microsoft Excel installed (desktop version recommended for full menu access).
- An open Excel workbook containing the data you wish to format.
- Basic familiarity with keyboard shortcuts or mouse navigation.
Step-by-Step
- Select the Entire Worksheet: Click the "Select All" button located at the top-left corner of the grid, exactly where the row numbers meet the column letters. Alternatively, press
Ctrl + Atwice if you are currently inside a table, or once if you are clicking on an empty area outside any specific range. Ensure that the entire sheet is highlighted. - Open the Home Tab: Navigate to the ribbon at the top of the window and ensure the Home tab is active. This tab contains most formatting tools.
- Locate the Format Menu: Look for the Cells group on the right side of the Home tab. Within this group, click the Format dropdown button. Note that menu labels can vary slightly depending on your Excel version or display language.
- Apply AutoFit Column Width: In the dropdown menu, select AutoFit Column Width. Excel will immediately adjust every column in the selected sheet so that the widest entry in each column fits completely within the cell boundaries.
- Apply AutoFit Row Height: Return to the same Format dropdown menu. Select AutoFit Row Height. This ensures that any wrapped text or multi-line entries expand vertically to remain visible.
- Verify the Results: Scroll through your spreadsheet to check for any anomalies. If some cells still show hash marks (
#####) or truncated text, repeat the process or manually adjust those specific columns, as merged cells often prevent standard autofit from working correctly.
Common Mistakes
One frequent error is attempting to autofit only a single column by double-clicking the border between column headers while other columns remain misaligned. While effective for one column, this does not clean up the whole sheet. Another common mistake is forgetting to unmerge cells before autofitting. Merged cells do not respond to AutoFit commands because Excel cannot calculate the optimal width based on multiple cells acting as one container. Additionally, users often overlook hidden rows or columns; if these contain long text, they may distort the visual layout even after autofitting visible areas.
Tips
For faster results, use keyboard shortcuts. After selecting the entire sheet with Ctrl + A, press Alt + H + O + I to auto-fit column widths, followed by Alt + H + O + A to auto-fit row heights. These sequences work in most desktop versions of Excel. If your data includes dates or numbers formatted as text, consider converting them to proper data types first, as text alignment can sometimes require more horizontal space than necessary. Finally, save your file before making bulk changes so you can easily revert if the automatic sizing creates unexpected layout issues.
Troubleshooting
If the autofit command does not seem to work, check if your worksheet is protected. Go to the Review tab and see if the Unprotect Sheet button is available. If it is, click it and enter any required password. Protected sheets restrict formatting changes, including column resizing. Next, inspect for merged cells. Select the problematic area and look at the Merge & Center button in the Home tab; if it is highlighted, unmerge the cells before trying again. If specific columns still display #####, it means the content is too wide for the maximum allowed column width (255 characters). In this case, you must shorten the text, wrap it using the Wrap Text option, or increase the font size reduction manually. Restarting Excel can also resolve temporary glitches where the interface fails to update the view after formatting.
Frequently Asked Questions
Does autofitting change the actual data?
No, autofitting only changes the visual presentation of the cells. The underlying values, formulas, and text remain exactly as they were entered. It simply adjusts the grid dimensions to accommodate what is already there.
Why did my date column turn into ##### symbols?
This happens when the column width is too narrow to display the date format. When you autofit, Excel calculates the width needed for the longest entry. If the date format is complex or the font is large, it might exceed the default view. Try changing the number format to a shorter date style (e.g., MM/DD/YYYY) or reducing the font size before autofitting.
Can I autofit just selected rows and columns?
Yes. Instead of selecting the whole sheet, highlight only the specific rows or columns you want to adjust. Then follow the same steps under the Format menu. This allows you to keep other parts of the sheet fixed while tidying up specific sections.
Will autofitting mess up my print layout?
Potentially. Autofitting prioritizes screen visibility, which might make columns wider than they need to be for printing. Always check Print Preview after autofitting. You may need to adjust page scaling settings or manually narrow columns to fit onto a standard paper size like Letter or A4.